diff options
author | Rigby <rigby@onarandombox.com> | 2011-08-11 10:29:39 +0100 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2011-08-12 21:19:53 -0400 |
commit | 96a0e87068a7c0a680d7b3577f1b7a8fec1204db (patch) | |
tree | 9366cb4fcd33836dd7dd8520bd1217daab5cd116 /src/main/java | |
parent | f795055012425d5e18ad836f25d849082ddc2aa9 (diff) | |
download | craftbukkit-96a0e87068a7c0a680d7b3577f1b7a8fec1204db.tar craftbukkit-96a0e87068a7c0a680d7b3577f1b7a8fec1204db.tar.gz craftbukkit-96a0e87068a7c0a680d7b3577f1b7a8fec1204db.tar.lz craftbukkit-96a0e87068a7c0a680d7b3577f1b7a8fec1204db.tar.xz craftbukkit-96a0e87068a7c0a680d7b3577f1b7a8fec1204db.zip |
Fixed chunks being overwritten with empty chunks when the memory setting is immediately changed after a world loads.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 8cf3dd1b..ed09f0f3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -800,7 +800,13 @@ public class CraftWorld implements World { if (keepLoaded) { loadChunk(chunkCoordX + x, chunkCoordZ + z); } else { - unloadChunk(chunkCoordX + x, chunkCoordZ + z); + if (isChunkLoaded(chunkCoordX + x, chunkCoordZ + z)) { + if (this.getHandle().getChunkAt(chunkCoordX + x, chunkCoordZ + z).isEmpty()) { + unloadChunk(chunkCoordX + x, chunkCoordZ + z, false); + } else { + unloadChunk(chunkCoordX + x, chunkCoordZ + z); + } + } } } } |