Skip to content

Commit af71138

Browse files
committed
Added unique id to class to help with hashing
1 parent 04cdbe6 commit af71138

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import world.bentobox.level.config.BlockConfig;
5757

5858
public class IslandLevelCalculator {
59+
private final UUID calcId = UUID.randomUUID(); // ID for hashing
5960
private static final String LINE_BREAK = "==================================";
6061
public static final long MAX_AMOUNT = 10000000;
6162
private static final int CHUNKS_TO_SCAN = 100;
@@ -788,4 +789,16 @@ private CompletableFuture<Void> handleStackedBlocks() {
788789

789790
}
790791

792+
@Override
793+
public boolean equals(Object o) {
794+
if (this == o) return true;
795+
if (!(o instanceof IslandLevelCalculator)) return false;
796+
IslandLevelCalculator that = (IslandLevelCalculator) o;
797+
return calcId.equals(that.calcId);
798+
}
799+
800+
@Override
801+
public int hashCode() {
802+
return calcId.hashCode();
803+
}
791804
}

0 commit comments

Comments
 (0)