Fix issues with chunk saving. Fixes BUKKIT-2158, BUKKIT-2018 and BUKKIT-2229

This commit is contained in:
Mike Primm
2012-08-12 18:40:49 -05:00
committed by EvilSeph
parent cacfc71b46
commit 5254993510
4 changed files with 33 additions and 22 deletions

View File

@@ -37,7 +37,7 @@ public class ChunkProviderServer implements IChunkProvider {
}
public boolean isChunkLoaded(int i, int j) {
return !this.unloadQueue.containsKey(i, j) && this.chunks.containsKey(i, j); // CraftBukkit
return this.chunks.containsKey(i, j); // CraftBukkit
}
public void queueUnload(int i, int j) {
@@ -47,11 +47,25 @@ public class ChunkProviderServer implements IChunkProvider {
int l = j * 16 + 8 - chunkcoordinates.z;
short short1 = 128;
if (k < -short1 || k > short1 || l < -short1 || l > short1 || !(this.world.keepSpawnInMemory)) { // CraftBukkit - added 'this.world.keepSpawnInMemory'
this.unloadQueue.add(i, j); // CraftBukkit
// CraftBukkit start
if (k < -short1 || k > short1 || l < -short1 || l > short1 || !(this.world.keepSpawnInMemory)) { // Added 'this.world.keepSpawnInMemory'
this.unloadQueue.add(i, j);
Chunk c = this.chunks.get(i, j);
if (c != null) {
c.mustSave = true;
}
}
// CraftBukkit end
} else {
this.unloadQueue.add(i, j); // CraftBukkit
// CraftBukkit start
this.unloadQueue.add(i, j);
Chunk c = this.chunks.get(i, j);
if (c != null) {
c.mustSave = true;
}
// CraftBukkit end
}
}