diff --git a/server/src/main/java/server/world/WorldServer.java b/server/src/main/java/server/world/WorldServer.java index b3bfd64f..c42bb3c0 100755 --- a/server/src/main/java/server/world/WorldServer.java +++ b/server/src/main/java/server/world/WorldServer.java @@ -1256,7 +1256,7 @@ public final class WorldServer extends AWorldServer { this.chunks.add(id, chunk); this.loaded.add(chunk); chunk.onChunkLoad(); - this.popChunk(x, z); + this.popChunk(x, z, false); } return chunk; @@ -1386,7 +1386,7 @@ public final class WorldServer extends AWorldServer { // } // } - private void popChunk(int x, int z) { + private void popChunk(int x, int z, boolean force) { boolean n = this.chunkExists(x, z - 1); boolean e = this.chunkExists(x + 1, z); boolean s = this.chunkExists(x, z + 1); @@ -1398,6 +1398,15 @@ public final class WorldServer extends AWorldServer { if(e && s && se) { this.populate(x, z); } + else if(force) { + if(!e) + this.loadChunk(x + 1, z); + if(!s) + this.loadChunk(x, z + 1); + if(!se) + this.loadChunk(x + 1, z + 1); + this.populate(x, z); + } if(w && s && sw) { this.populate(x - 1, z); } @@ -1587,8 +1596,10 @@ public final class WorldServer extends AWorldServer { // chunk.checkLight(); // chunk.setModified(true); } - for(ChunkServer chunk : this.loaded) { - this.popChunk(chunk.xPos, chunk.zPos); + loaded.clear(); + loaded.addAll(this.loaded); + for(ChunkServer chunk : loaded) { + this.popChunk(chunk.xPos, chunk.zPos, true); chunk.update(false); } this.entities.removeAll(this.unloaded);