readd chunk pos long optimization
This commit is contained in:
@@ -106,12 +106,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void load(@Nullable Level level, BlockPos pos, CompoundTag tag) {
|
public void load(@Nullable Level level, BlockPos pos, CompoundTag tag) {
|
||||||
- this.spawnDelay = tag.getShort("Delay");
|
|
||||||
+ // Paper start - use larger int if set
|
+ // Paper start - use larger int if set
|
||||||
+ if (tag.contains("Paper.Delay")) {
|
+ if (tag.contains("Paper.Delay")) {
|
||||||
+ this.spawnDelay = tag.getInt("Paper.Delay");
|
+ this.spawnDelay = tag.getInt("Paper.Delay");
|
||||||
+ } else {
|
+ } else {
|
||||||
+ this.spawnDelay = tag.getShort("Delay");
|
this.spawnDelay = tag.getShort("Delay");
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
boolean flag = tag.contains("SpawnData", 10);
|
boolean flag = tag.contains("SpawnData", 10);
|
||||||
|
|||||||
@@ -28,3 +28,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static ChunkPos minFromRegion(int chunkX, int chunkZ) {
|
public static ChunkPos minFromRegion(int chunkX, int chunkZ) {
|
||||||
|
@@ -74,7 +_,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
public long toLong() {
|
||||||
|
- return asLong(this.x, this.z);
|
||||||
|
+ return this.longKey; // Paper
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long asLong(int x, int z) {
|
||||||
|
|||||||
Reference in New Issue
Block a user