diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-03-31 19:18:42 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-03-31 19:18:42 -0500 |
commit | 71a475f0764c459dffbcbc32db36953b18a67afa (patch) | |
tree | cb4b7edf3cdfc61dacbaa55a58abe066b0e2d011 /src/main/java/net/minecraft/server/ItemBlock.java | |
parent | d3dbb1bb50f6ca7a19c00913273b4952044a9347 (diff) | |
download | craftbukkit-71a475f0764c459dffbcbc32db36953b18a67afa.tar craftbukkit-71a475f0764c459dffbcbc32db36953b18a67afa.tar.gz craftbukkit-71a475f0764c459dffbcbc32db36953b18a67afa.tar.lz craftbukkit-71a475f0764c459dffbcbc32db36953b18a67afa.tar.xz craftbukkit-71a475f0764c459dffbcbc32db36953b18a67afa.zip |
Don't update physics when block place is cancelled. Fixes BUKKIT-3939
When a block placement happens we currently update physics on the
attempted placement and update again if the placement is cancelled.
To correct the first one we simply set the block without applying
physics. To correct the second we have to add a new method to
BlockState that lets us update without applying physics and use
this method method when putting the block back.
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemBlock.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemBlock.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java index ba2feafd..01c06af2 100644 --- a/src/main/java/net/minecraft/server/ItemBlock.java +++ b/src/main/java/net/minecraft/server/ItemBlock.java @@ -80,11 +80,11 @@ public class ItemBlock extends Item { org.bukkit.block.BlockState blockstate = org.bukkit.craftbukkit.block.CraftBlockState.getBlockState(world, x, y, z); world.callingPlaceEvent = true; - world.setTypeIdAndData(x, y, z, id, data, 3); + world.setTypeIdAndData(x, y, z, id, data, 2); org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockstate, clickedX, clickedY, clickedZ); if (event.isCancelled() || !event.canBuild()) { - blockstate.update(true); + blockstate.update(true, false); world.callingPlaceEvent = false; return false; } |