diff options
author | AgentLV <contact@agentlv.net> | 2016-03-14 23:26:23 +0100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-03-16 07:14:10 +1100 |
commit | 8b69bdd0d1c4a6f6cfc32e60e30751f5f6440ce7 (patch) | |
tree | c5ca5609035cf6c0e8ff00eea4c8b949bacd705b | |
parent | 45adbd9c6f4fd2fb2d971192904be21f01a70097 (diff) | |
download | craftbukkit-8b69bdd0d1c4a6f6cfc32e60e30751f5f6440ce7.tar craftbukkit-8b69bdd0d1c4a6f6cfc32e60e30751f5f6440ce7.tar.gz craftbukkit-8b69bdd0d1c4a6f6cfc32e60e30751f5f6440ce7.tar.lz craftbukkit-8b69bdd0d1c4a6f6cfc32e60e30751f5f6440ce7.tar.xz craftbukkit-8b69bdd0d1c4a6f6cfc32e60e30751f5f6440ce7.zip |
Add hand used to BlockPlaceEvent.
-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; |