2021-06-11 12:02:28 +00: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
|
2021-09-11 10:22:51 +00:00
|
|
|
index aa652bfcd0e60784afc36a800a0278c3baa32221..8063583b8b59534d277d14c28faa607efc1e26ed 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
2021-09-01 12:03:36 +00:00
|
|
|
@@ -343,13 +343,18 @@ public class CraftEventFactory {
|
2021-06-11 12:02:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
org.bukkit.inventory.ItemStack item;
|
2021-09-11 10:22:51 +00:00
|
|
|
+ // Paper start - add hand to BlockMultiPlaceEvent
|
2021-06-11 12:02:28 +00: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);
|
2021-09-11 10:22:51 +00:00
|
|
|
+ // Paper end
|
2021-06-11 12:02:28 +00:00
|
|
|
craftServer.getPluginManager().callEvent(event);
|
|
|
|
|
|
|
|
return event;
|