fix world reset chunk repop
This commit is contained in:
parent
c261317be9
commit
0c6ea439eb
1 changed files with 15 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue