From 966fe904a22a7edc74dd42abe7df98b6c7cfdbb6 Mon Sep 17 00:00:00 2001 From: Trigary Date: Sun, 1 Mar 2020 22:43:24 +0100 Subject: [PATCH] add hand to BlockMultiPlaceEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 39ce40bd58..1f5d15bb49 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -296,13 +296,18 @@ public class CraftEventFactory { } org.bukkit.inventory.ItemStack item; + //Paper start - add hand to BlockMultiPlaceEvent + EquipmentSlot equipmentSlot; if (hand == EnumHand.MAIN_HAND) { item = player.getInventory().getItemInMainHand(); + equipmentSlot = EquipmentSlot.HAND; } else { item = player.getInventory().getItemInOffHand(); + equipmentSlot = EquipmentSlot.OFF_HAND; } - BlockMultiPlaceEvent event = new BlockMultiPlaceEvent(blockStates, blockClicked, item, player, canBuild); + BlockMultiPlaceEvent event = new BlockMultiPlaceEvent(blockStates, blockClicked, item, player, canBuild, equipmentSlot); + //Paper end craftServer.getPluginManager().callEvent(event); return event; -- 2.25.1