#1107: Add getHand() to all relevant events
By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
public class ItemHanging extends Item {
|
||||
|
||||
private final EntityTypes<? extends EntityHanging> type;
|
||||
@@ -65,6 +70,18 @@
|
||||
@@ -65,6 +70,19 @@
|
||||
|
||||
if (((EntityHanging) object).survives()) {
|
||||
if (!world.isClientSide) {
|
||||
@@ -20,8 +20,9 @@
|
||||
+ Player who = (itemactioncontext.getPlayer() == null) ? null : (Player) itemactioncontext.getPlayer().getBukkitEntity();
|
||||
+ org.bukkit.block.Block blockClicked = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ org.bukkit.block.BlockFace blockFace = org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(enumdirection);
|
||||
+ org.bukkit.inventory.EquipmentSlot hand = org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(itemactioncontext.getHand());
|
||||
+
|
||||
+ HangingPlaceEvent event = new HangingPlaceEvent((org.bukkit.entity.Hanging) ((EntityHanging) object).getBukkitEntity(), who, blockClicked, blockFace, org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack));
|
||||
+ HangingPlaceEvent event = new HangingPlaceEvent((org.bukkit.entity.Hanging) ((EntityHanging) object).getBukkitEntity(), who, blockClicked, blockFace, hand, org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack));
|
||||
+ world.getCraftServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (event.isCancelled()) {
|
||||
|
||||
Reference in New Issue
Block a user