Extend HumanEntity#dropItem API (#11810)
This commit is contained in:
@@ -112,16 +112,21 @@
|
||||
this.removeEntitiesOnShoulder();
|
||||
}
|
||||
}
|
||||
@@ -717,6 +_,13 @@
|
||||
@@ -717,6 +_,18 @@
|
||||
|
||||
@Nullable
|
||||
public ItemEntity drop(ItemStack droppedItem, boolean dropAround, boolean includeThrowerName) {
|
||||
+ // CraftBukkit start - SPIGOT-2942: Add boolean to call event
|
||||
+ return this.drop(droppedItem, dropAround, includeThrowerName, true);
|
||||
+ return this.drop(droppedItem, dropAround, includeThrowerName, true, null);
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ public ItemEntity drop(ItemStack droppedItem, boolean dropAround, boolean includeThrowerName, boolean callEvent) {
|
||||
+ return this.drop(droppedItem, dropAround, includeThrowerName, callEvent, null);
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ public ItemEntity drop(ItemStack droppedItem, boolean dropAround, boolean includeThrowerName, boolean callEvent, @Nullable java.util.function.Consumer<org.bukkit.entity.Item> entityOperation) {
|
||||
+ // CraftBukkit end
|
||||
if (!droppedItem.isEmpty() && this.level().isClientSide) {
|
||||
this.swing(InteractionHand.MAIN_HAND);
|
||||
|
||||
Reference in New Issue
Block a user