aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0331-add-hand-to-BlockMultiPlaceEvent.patch
blob: fe9e4dc449bdee0a191d06f9655fafdc8829aa4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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 449dab3d6e16b2b0fcc78c9e1b7173c822be9c53..15c9150b7e48781268babe5915dc0e906645b341 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -402,13 +402,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;