Improve implementation of chunk leak clean to not run as often

This commit is contained in:
Aikar
2020-05-25 21:42:53 -04:00
parent 1b23cf5819
commit a73ee9f448
2 changed files with 75 additions and 29 deletions

View File

@@ -2681,7 +2681,32 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
+++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
@@ -0,0 +0,0 @@ public class ChunkCoordIntPair {
return pair(this.x, this.z);
public static final long a = pair(1875016, 1875016);
public final int x;
public final int z;
+ public final long longKey; // Paper
public ChunkCoordIntPair(int i, int j) {
this.x = i;
this.z = j;
+ this.longKey = pair(this.x, this.z); // Paper
}
public ChunkCoordIntPair(BlockPosition blockposition) {
this.x = blockposition.getX() >> 4;
this.z = blockposition.getZ() >> 4;
+ this.longKey = pair(this.x, this.z); // Paper
}
public ChunkCoordIntPair(long i) {
this.x = (int) i;
this.z = (int) (i >> 32);
+ this.longKey = pair(this.x, this.z); // Paper
}
public long pair() {
- return pair(this.x, this.z);
+ return longKey; // Paper
}
- public static long pair(int i, int j) {