diff options
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 859de8a2..0abfc608 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -132,13 +132,16 @@ public class CraftEventFactory { boolean canBuild = canBuild(craftWorld, player, placedBlock.getX(), placedBlock.getZ()); org.bukkit.inventory.ItemStack item; + EquipmentSlot equipmentSlot; if (hand == EnumHand.MAIN_HAND) { item = player.getInventory().getItemInMainHand(); + equipmentSlot = EquipmentSlot.HAND; } else { item = player.getInventory().getItemInOffHand(); + equipmentSlot = EquipmentSlot.OFF_HAND; } - BlockPlaceEvent event = new BlockPlaceEvent(placedBlock, replacedBlockState, blockClicked, item, player, canBuild); + BlockPlaceEvent event = new BlockPlaceEvent(placedBlock, replacedBlockState, blockClicked, item, player, canBuild, equipmentSlot); craftServer.getPluginManager().callEvent(event); return event; |