mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-31 00:20:44 +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;
|
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;
|
||||||
|
|
Loading…
Reference in a new issue