Even more cleanup of mcutil patch

This commit is contained in:
Nassim Jahnke
2024-07-18 16:50:16 +02:00
parent 0b2291042a
commit dc136446fb
12 changed files with 96 additions and 968 deletions

View File

@@ -31,6 +31,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import java.util.List;
+import java.util.Map;
+import java.util.WeakHashMap;
+import net.minecraft.world.level.ChunkPos;
+import net.minecraft.world.level.Level;
+
+public class SyncLoadFinder {
@@ -69,7 +70,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ ++valueInMap.times;
+
+ valueInMap.coordinateTimes.compute(io.papermc.paper.util.MCUtil.getCoordinateKey(chunkX, chunkZ), (Long keyInMap1, Integer valueInMap1) -> {
+ valueInMap.coordinateTimes.compute(ChunkPos.asLong(chunkX, chunkZ), (Long keyInMap1, Integer valueInMap1) -> {
+ return valueInMap1 == null ? Integer.valueOf(1) : Integer.valueOf(valueInMap1.intValue() + 1);
+ });
+
@@ -122,7 +123,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ for (Long2IntMap.Entry coordinate : pair.getSecond().coordinateTimes.long2IntEntrySet()) {
+ final long key = coordinate.getLongKey();
+ final int times = coordinate.getIntValue();
+ coordinates.add("(" + io.papermc.paper.util.MCUtil.getCoordinateX(key) + "," + io.papermc.paper.util.MCUtil.getCoordinateZ(key) + "): " + times);
+ final ChunkPos chunkPos = new ChunkPos(key);
+ coordinates.add("(" + chunkPos.x + "," + chunkPos.z + "): " + times);
+ }
+
+ stacktrace.add("coordinates", coordinates);