SPIGOT-1607: Fix BlockPlaceEvent and BlockMultiPlaceEvent sometimes showing the wrong item used

By: Thinkofdeath <thinkofdeath@spigotmc.org>
This commit is contained in:
CraftBukkit/Spigot
2016-03-01 21:37:08 +00:00
parent 8c803cbf66
commit d0300bb4e0
4 changed files with 24 additions and 10 deletions

View File

@@ -33,7 +33,7 @@
world.setTypeAndData(blockposition, Blocks.FIRE.getBlockData(), 11);
+
+ // CraftBukkit start
+ org.bukkit.event.block.BlockPlaceEvent placeEvent = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clicked.getX(), clicked.getY(), clicked.getZ());
+ org.bukkit.event.block.BlockPlaceEvent placeEvent = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, enumhand, blockState, clicked.getX(), clicked.getY(), clicked.getZ());
+
+ if (placeEvent.isCancelled() || !placeEvent.canBuild()) {
+ placeEvent.getBlockPlaced().setTypeIdAndData(0, (byte) 0, false);