mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-01 00:10:32 +01:00
31 lines
1.4 KiB
Diff
31 lines
1.4 KiB
Diff
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 7c92f9e4b39310da2f112b9c3dac0b9d0c6bcf24..502196b8e97f3de3399f5542e76e6dbbd044d3fd 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
@@ -400,13 +400,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;
|