diff options
author | Wizjany <wizjany@gmail.com> | 2012-12-27 13:55:32 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-12-27 15:22:19 -0600 |
commit | 5963da294f4924eb1035d1e6c7a3619d500d4546 (patch) | |
tree | 815da7db84607e5b6ec5eb4a2a19eff566b2ed9b /src/main/java | |
parent | 49da990ee331d42bd84141fae60ca9ee503619c3 (diff) | |
download | craftbukkit-5963da294f4924eb1035d1e6c7a3619d500d4546.tar craftbukkit-5963da294f4924eb1035d1e6c7a3619d500d4546.tar.gz craftbukkit-5963da294f4924eb1035d1e6c7a3619d500d4546.tar.lz craftbukkit-5963da294f4924eb1035d1e6c7a3619d500d4546.tar.xz craftbukkit-5963da294f4924eb1035d1e6c7a3619d500d4546.zip |
Don't update physics until after the place event. Fixes BUKKIT-3316
If you cancel a BlockPlaceEvent for a sign the world is updated as if
the block was placed and then destroyed. To avoid this we set the block
without updating physics then apply the update after the event.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemSign.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/ItemSign.java b/src/main/java/net/minecraft/server/ItemSign.java index 1d09df1c..f4717e1e 100644 --- a/src/main/java/net/minecraft/server/ItemSign.java +++ b/src/main/java/net/minecraft/server/ItemSign.java @@ -48,17 +48,23 @@ public class ItemSign extends Item { if (l == 1) { int i1 = MathHelper.floor((double) ((entityhuman.yaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; - world.setTypeIdAndData(i, j, k, Block.SIGN_POST.id, i1); + // CraftBukkit start - sign + world.setRawTypeIdAndData(i, j, k, Block.SIGN_POST.id, i1); } else { - world.setTypeIdAndData(i, j, k, Block.WALL_SIGN.id, l); + world.setRawTypeIdAndData(i, j, k, Block.WALL_SIGN.id, l); } - // CraftBukkit start - sign org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ); if (event.isCancelled() || !event.canBuild()) { event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false); return false; + } else { + if (l == 1) { + world.update(i, j, k, Block.SIGN_POST.id); + } else { + world.update(i, j, k, Block.WALL_SIGN.id); + } } // CraftBukkit end |