add hand to BlockMultiPlaceEvent

This commit is contained in:
Trigary 2020-03-01 22:43:24 +01:00
parent fa7c667a3e
commit 4bff4be120

View file

@ -411,13 +411,18 @@ public class CraftEventFactory {
} }
org.bukkit.inventory.ItemStack item; org.bukkit.inventory.ItemStack item;
// Paper start - add hand to BlockMultiPlaceEvent
EquipmentSlot equipmentSlot;
if (hand == InteractionHand.MAIN_HAND) { if (hand == InteractionHand.MAIN_HAND) {
item = player.getInventory().getItemInMainHand(); item = player.getInventory().getItemInMainHand();
equipmentSlot = EquipmentSlot.HAND;
} else { } else {
item = player.getInventory().getItemInOffHand(); 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); craftServer.getPluginManager().callEvent(event);
return event; return event;