mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
add hand to BlockMultiPlaceEvent
This commit is contained in:
parent
fa7c667a3e
commit
4bff4be120
1 changed files with 6 additions and 1 deletions
|
@ -411,13 +411,18 @@ public class CraftEventFactory {
|
|||
}
|
||||
|
||||
org.bukkit.inventory.ItemStack item;
|
||||
// Paper start - add hand to BlockMultiPlaceEvent
|
||||
EquipmentSlot equipmentSlot;
|
||||
if (hand == InteractionHand.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;
|
||||
|
|
Loading…
Reference in a new issue