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
|
2021-07-18 09:41:53 +02:00
|
|
|
index 934ea2cf75c44e7e5f2e302a2d2fc14da54d3310..19fa07423caefe601456ee775812b9c032384e9e 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
|
2021-06-14 00:05:18 +02:00
|
|
|
@@ -339,13 +339,18 @@ public class CraftEventFactory {
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|