2020-05-02 00:03:47 +02:00
|
|
|
From 8a2660468466486b4fe5fb1107be67204f4d6699 Mon Sep 17 00:00:00 2001
|
2020-03-02 21:55:31 +01:00
|
|
|
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
|
2020-05-02 00:03:47 +02:00
|
|
|
index fcf2b190aa..c3f7e46121 100644
|
2020-03-02 21:55:31 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
2020-05-02 00:03:47 +02:00
|
|
|
@@ -303,13 +303,18 @@ public class CraftEventFactory {
|
2020-03-02 21:55:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
org.bukkit.inventory.ItemStack item;
|
|
|
|
+ //Paper start - add hand to BlockMultiPlaceEvent
|
|
|
|
+ EquipmentSlot equipmentSlot;
|
|
|
|
if (hand == EnumHand.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;
|
|
|
|
--
|
2020-05-02 00:03:47 +02:00
|
|
|
2.26.2
|
2020-03-02 21:55:31 +01:00
|
|
|
|