Skip to content

Commit 1f61098

Browse files
committed
Add comments to PoiOrdering
1 parent f71411d commit 1f61098

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

  • common/src/main/java/net/caffeinemc/mods/lithium/common/world/interests

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ default Comparator<BlockPos> getAsComparator(BlockPos center, PoiManager poiMana
5555
int compare(BlockPos center, PoiManager poiManager, BlockPos posA, BlockPos posB);
5656

5757

58+
/**
59+
* Order:
60+
* - lower chunk Y first
61+
* - POI type hashmap iteration order
62+
* - Typed POI record hashmap iteration order
63+
*/
5864
record InChunk() implements PoiOrdering {
5965

6066
public static final InChunk INSTANCE = new InChunk();
@@ -106,6 +112,13 @@ public int compare(BlockPos center, PoiManager poiManager, BlockPos posA, BlockP
106112
}
107113
}
108114

115+
116+
/**
117+
* Order:
118+
* - lower chunk Z first
119+
* - lower chunk X first
120+
* - InChunk order
121+
*/
109122
record InSquare() implements PoiOrdering {
110123

111124
public static final InSquare INSTANCE = new InSquare();
@@ -132,6 +145,12 @@ public int compare(BlockPos center, PoiManager poiManager, BlockPos posA, BlockP
132145
}
133146
}
134147

148+
149+
/**
150+
* Order:
151+
* - lower distance squared first
152+
* - InSquare order
153+
*/
135154
record L2ThenInSquare() implements PoiOrdering {
136155

137156
public static final L2ThenInSquare INSTANCE = new L2ThenInSquare();
@@ -150,6 +169,12 @@ public int compare(BlockPos center, PoiManager poiManager, BlockPos posA, BlockP
150169
}
151170
}
152171

172+
/**
173+
* Order:
174+
* - lower distance squared first
175+
* - lower Y first
176+
* - InSquare order
177+
*/
153178
record L2ThenMinYThenInSquare() implements PoiOrdering {
154179

155180
public static final L2ThenMinYThenInSquare INSTANCE = new L2ThenMinYThenInSquare();

0 commit comments

Comments
 (0)