mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
Fix regenerating chunks not updating visually
This commit is contained in:
1 parent
a06e5cf8e8
commit
0cd6711085
2 files changed
+24
-3
No files matched your search
@@ -195,6 +195,21 @@ public class CraftWorld implements World {
|
||||
world.getChunkProviderServer().unloadQueue.remove(x, z);
|
||||
world.getChunkProviderServer().chunks.remove(LongHash.toLong(x, z));
|
||||
|
||||
// Update neighbor counts
|
||||
for (int xx = -2; xx < 3; xx++) {
|
||||
for (int zz = -2; zz < 3; zz++) {
|
||||
if (xx == 0 && zz == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
net.minecraft.server.Chunk neighbor = world.getChunkProviderServer().getChunkIfLoaded(chunk.locX + x, chunk.locZ + z);
|
||||
if (neighbor != null) {
|
||||
neighbor.setNeighborUnloaded(-xx, -zz);
|
||||
chunk.setNeighborUnloaded(xx, zz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -206,6 +221,10 @@ public class CraftWorld implements World {
|
||||
net.minecraft.server.Chunk chunk = null;
|
||||
|
||||
chunk = world.getChunkProviderServer().chunkGenerator.getOrCreateChunk(x, z);
|
||||
PlayerChunk playerChunk = world.getPlayerChunkMap().b/*PAIL: Rename*/(x, z);
|
||||
if (playerChunk != null) {
|
||||
playerChunk.chunk = chunk;
|
||||
}
|
||||
|
||||
chunkLoadPostProcess(chunk, x, z);
|
||||
|
||||
|
||||
Reference in new issue
Block a user