diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-12-24 21:51:15 -0600 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-12-24 21:51:15 -0600 |
commit | 32d9db82e5a2a7b1746d170349876337b2684b6c (patch) | |
tree | 41fa82125c85c4247368c85db2762746ee7aed4e /src | |
parent | c57e45dcdc6493e1f0b60ff53de280b3a5a118f3 (diff) | |
download | craftbukkit-32d9db82e5a2a7b1746d170349876337b2684b6c.tar craftbukkit-32d9db82e5a2a7b1746d170349876337b2684b6c.tar.gz craftbukkit-32d9db82e5a2a7b1746d170349876337b2684b6c.tar.lz craftbukkit-32d9db82e5a2a7b1746d170349876337b2684b6c.tar.xz craftbukkit-32d9db82e5a2a7b1746d170349876337b2684b6c.zip |
Only delay removing containers. Fixes BUKKIT-5238
In commit f94b7af8 I delay removing the block until after running the
block's cleanup code to avoid errors. However, this causes problems of
its own due to blocks not being written with this in mind. To avoid blocks
getting recursively removed we now only delay removing containers since
they are the only ones we had problems with to begin with.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/Chunk.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java index 014136c1..bc3dd41d 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -430,13 +430,23 @@ public class Chunk { block1.f(this.world, l1, j, i2, k1); } - // chunksection.setTypeId(i, j & 15, k, block); // CraftBukkit - Moved down + // CraftBukkit start - Delay removing containers until after they're cleaned up + if (!(block1 instanceof IContainer)) { + chunksection.setTypeId(i, j & 15, k, block); + } + // CraftBukkit end + if (!this.world.isStatic) { block1.remove(this.world, l1, j, i2, block1, k1); } else if (block1 instanceof IContainer && block1 != block) { this.world.p(l1, j, i2); } - chunksection.setTypeId(i, j & 15, k, block); // CraftBukkit - Set new block after cleaning up old one + + // CraftBukkit start - Remove containers now after cleanup + if (block1 instanceof IContainer) { + chunksection.setTypeId(i, j & 15, k, block); + } + // CraftBukkit end if (chunksection.getTypeId(i, j & 15, k) != block) { return false; |