mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 18:27:17 +01:00
This should fix the chunk ghosting bug
This commit is contained in:
parent
9869ace146
commit
7242f21a32
2 changed files with 8 additions and 2 deletions
|
@ -36,12 +36,16 @@ public class CraftChunk implements Chunk {
|
|||
public net.minecraft.server.Chunk getHandle() {
|
||||
net.minecraft.server.Chunk c = weakChunk.get();
|
||||
if (c == null) {
|
||||
weakChunk = new WeakReference<net.minecraft.server.Chunk>(worldServer.c(x,z));
|
||||
c = weakChunk.get();
|
||||
c = worldServer.c(x,z);
|
||||
weakChunk = new WeakReference<net.minecraft.server.Chunk>(c);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
void breakLink() {
|
||||
weakChunk.clear();
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ public class CraftWorld implements World {
|
|||
}
|
||||
|
||||
public void preserveChunk( CraftChunk chunk ) {
|
||||
chunk.breakLink();
|
||||
unloadedChunks.put( (chunk.getX() << 16) + chunk.getZ(), chunk );
|
||||
}
|
||||
|
||||
|
@ -141,6 +142,7 @@ public class CraftWorld implements World {
|
|||
provider.a(chunk);
|
||||
}
|
||||
|
||||
preserveChunk((CraftChunk)chunk.bukkitChunk);
|
||||
provider.a.remove(x, z);
|
||||
provider.e.remove(x, z);
|
||||
provider.f.remove(chunk);
|
||||
|
|
Loading…
Reference in a new issue