summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server
diff options
context:
space:
mode:
authorErik Broes <erikbroes@grum.nl>2011-02-20 17:09:02 +0100
committerErik Broes <erikbroes@grum.nl>2011-02-20 17:09:38 +0100
commit6e3ee31336dcec939139cc97cab11d98fb99145d (patch)
tree4aa5c31f92338d42ccaf6fc27bfdf9439984c9dd /src/main/java/net/minecraft/server
parentca4076077eb8514b2e5bbeb315058b12169e7b81 (diff)
downloadcraftbukkit-6e3ee31336dcec939139cc97cab11d98fb99145d.tar
craftbukkit-6e3ee31336dcec939139cc97cab11d98fb99145d.tar.gz
craftbukkit-6e3ee31336dcec939139cc97cab11d98fb99145d.tar.lz
craftbukkit-6e3ee31336dcec939139cc97cab11d98fb99145d.tar.xz
craftbukkit-6e3ee31336dcec939139cc97cab11d98fb99145d.zip
Prevent Blocks from getting lost when a chunk reloads
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r--src/main/java/net/minecraft/server/Chunk.java5
-rw-r--r--src/main/java/net/minecraft/server/ChunkProviderServer.java2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index e37db53f..592e3408 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -44,7 +44,10 @@ public class Chunk {
}
// CraftBukkit start
- bukkitChunk = new org.bukkit.craftbukkit.CraftChunk( this );
+ bukkitChunk = ((WorldServer) world).getWorld().popPreservedChunk( i, j );
+ if (bukkitChunk == null) {
+ bukkitChunk = new org.bukkit.craftbukkit.CraftChunk( this );
+ }
}
public org.bukkit.Chunk bukkitChunk;
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 87beef57..e6b4be5e 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -209,6 +209,8 @@ public class ChunkProviderServer implements IChunkProvider
ChunkUnloadEvent cue = new ChunkUnloadEvent(Type.CHUNK_UNLOADED, chunk.bukkitChunk);
server.getPluginManager().callEvent(cue);
if (!cue.isCancelled()) {
+ g.getWorld().preserveChunk( (CraftChunk) chunk.bukkitChunk );
+
chunk.e();
this.b(chunk);
this.a(chunk);