mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 02:22:12 +01:00
b01c811c2f
== AT == public net.minecraft.server.level.ServerChunkCache mainThread public net.minecraft.server.level.ServerLevel chunkSource public org.bukkit.craftbukkit.inventory.CraftItemStack handle public net.minecraft.server.level.ChunkMap getVisibleChunkIfPresent(J)Lnet/minecraft/server/level/ChunkHolder; public net.minecraft.server.level.ServerChunkCache mainThreadProcessor public net.minecraft.server.level.ServerChunkCache$MainThreadExecutor public net.minecraft.world.level.chunk.LevelChunkSection states
39 lines
1.2 KiB
Diff
39 lines
1.2 KiB
Diff
--- a/net/minecraft/world/level/ChunkPos.java
|
|
+++ b/net/minecraft/world/level/ChunkPos.java
|
|
@@ -46,6 +46,7 @@
|
|
public static final int REGION_MAX_INDEX = 31;
|
|
public final int x;
|
|
public final int z;
|
|
+ public final long longKey; // Paper
|
|
private static final int HASH_A = 1664525;
|
|
private static final int HASH_C = 1013904223;
|
|
private static final int HASH_Z_XOR = -559038737;
|
|
@@ -53,16 +54,19 @@
|
|
public ChunkPos(int x, int z) {
|
|
this.x = x;
|
|
this.z = z;
|
|
+ this.longKey = asLong(this.x, this.z); // Paper
|
|
}
|
|
|
|
public ChunkPos(BlockPos pos) {
|
|
this.x = SectionPos.blockToSectionCoord(pos.getX());
|
|
this.z = SectionPos.blockToSectionCoord(pos.getZ());
|
|
+ this.longKey = asLong(this.x, this.z); // Paper
|
|
}
|
|
|
|
public ChunkPos(long pos) {
|
|
this.x = (int)pos;
|
|
this.z = (int)(pos >> 32);
|
|
+ this.longKey = asLong(this.x, this.z); // Paper
|
|
}
|
|
|
|
public static ChunkPos minFromRegion(int x, int z) {
|
|
@@ -74,7 +78,7 @@
|
|
}
|
|
|
|
public long toLong() {
|
|
- return asLong(this.x, this.z);
|
|
+ return longKey; // Paper
|
|
}
|
|
|
|
public static long asLong(int chunkX, int chunkZ) {
|