Paper/patches/server/0331-add-hand-to-BlockMultiPlaceEvent.patch

31 lines
1.4 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Trigary <trigary0@gmail.com>
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 542b9ff7d845dcebcf6569a6d4bd9e97ac3a436d..3dee6c973d4b4ac6f64fdcb5ac7fa681cefbdb1c 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -401,13 +401,18 @@ public class CraftEventFactory {
2021-06-11 14:02:28 +02:00
}
org.bukkit.inventory.ItemStack item;
+ // Paper start - add hand to BlockMultiPlaceEvent
2021-06-11 14:02:28 +02:00
+ 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
2021-06-11 14:02:28 +02:00
craftServer.getPluginManager().callEvent(event);
return event;