Skip to content

Commit 70c7731

Browse files
committed
Fix PoiOrdering handling equal positions incorrectly
1 parent 1f61098 commit 70c7731

File tree

1 file changed

+5
-1
lines changed
  • common/src/main/java/net/caffeinemc/mods/lithium/common/world/interests

1 file changed

+5
-1
lines changed

common/src/main/java/net/caffeinemc/mods/lithium/common/world/interests/PoiOrdering.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,18 @@ default Comparator<BlockPos> getAsComparator(BlockPos center, PoiManager poiMana
5959
* Order:
6060
* - lower chunk Y first
6161
* - POI type hashmap iteration order
62-
* - Typed POI record hashmap iteration order
62+
* - Typed POI record hashset iteration order
6363
*/
6464
record InChunk() implements PoiOrdering {
6565

6666
public static final InChunk INSTANCE = new InChunk();
6767

6868
@Override
6969
public int compare(BlockPos center, PoiManager poiManager, BlockPos posA, BlockPos posB) {
70+
if (posA.equals(posB)) {
71+
return 0;
72+
}
73+
7074
int aChunkZ = posA.getZ() >> 4;
7175
int bChunkZ = posB.getZ() >> 4;
7276

0 commit comments

Comments
 (0)