Fix some [but not all] chunk unload issues

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2016-05-11 15:34:16 +10:00
parent d506c12c07
commit 3d3e6cdcad
2 changed files with 34 additions and 72 deletions

View File

@@ -203,7 +203,7 @@ public class CraftWorld implements World {
world.getChunkProviderServer().saveChunkNOP(chunk);
}
world.getChunkProviderServer().unloadQueue.remove(x, z);
world.getChunkProviderServer().unloadQueue.remove(ChunkCoordIntPair.a(x, z));
world.getChunkProviderServer().chunks.remove(ChunkCoordIntPair.a(x, z));
// Update neighbor counts
@@ -227,7 +227,7 @@ public class CraftWorld implements World {
public boolean regenerateChunk(int x, int z) {
unloadChunk0(x, z, false, false);
world.getChunkProviderServer().unloadQueue.remove(x, z);
world.getChunkProviderServer().unloadQueue.remove(ChunkCoordIntPair.a(x, z));
net.minecraft.server.Chunk chunk = null;
@@ -275,7 +275,7 @@ public class CraftWorld implements World {
return world.getChunkProviderServer().getChunkAt(x, z) != null;
}
world.getChunkProviderServer().unloadQueue.remove(x, z);
world.getChunkProviderServer().unloadQueue.remove(ChunkCoordIntPair.a(x, z));
net.minecraft.server.Chunk chunk = world.getChunkProviderServer().chunks.get(ChunkCoordIntPair.a(x, z));
if (chunk == null) {
@@ -1515,7 +1515,7 @@ public class CraftWorld implements World {
}
// Already unloading?
if (cps.unloadQueue.contains(chunk.locX, chunk.locZ)) {
if (cps.unloadQueue.contains(ChunkCoordIntPair.a(chunk.locX, chunk.locZ))) {
continue;
}