geforkt von Mirrors/Paper
This should fix the chunk ghosting bug
Dieser Commit ist enthalten in:
Ursprung
9869ace146
Commit
7242f21a32
@ -36,12 +36,16 @@ public class CraftChunk implements Chunk {
|
|||||||
public net.minecraft.server.Chunk getHandle() {
|
public net.minecraft.server.Chunk getHandle() {
|
||||||
net.minecraft.server.Chunk c = weakChunk.get();
|
net.minecraft.server.Chunk c = weakChunk.get();
|
||||||
if (c == null) {
|
if (c == null) {
|
||||||
weakChunk = new WeakReference<net.minecraft.server.Chunk>(worldServer.c(x,z));
|
c = worldServer.c(x,z);
|
||||||
c = weakChunk.get();
|
weakChunk = new WeakReference<net.minecraft.server.Chunk>(c);
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void breakLink() {
|
||||||
|
weakChunk.clear();
|
||||||
|
}
|
||||||
|
|
||||||
public int getX() {
|
public int getX() {
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ public class CraftWorld implements World {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void preserveChunk( CraftChunk chunk ) {
|
public void preserveChunk( CraftChunk chunk ) {
|
||||||
|
chunk.breakLink();
|
||||||
unloadedChunks.put( (chunk.getX() << 16) + chunk.getZ(), chunk );
|
unloadedChunks.put( (chunk.getX() << 16) + chunk.getZ(), chunk );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,6 +142,7 @@ public class CraftWorld implements World {
|
|||||||
provider.a(chunk);
|
provider.a(chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
preserveChunk((CraftChunk)chunk.bukkitChunk);
|
||||||
provider.a.remove(x, z);
|
provider.a.remove(x, z);
|
||||||
provider.e.remove(x, z);
|
provider.e.remove(x, z);
|
||||||
provider.f.remove(chunk);
|
provider.f.remove(chunk);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren