SPIGOT-4938: Call EntityPickupItemEvent for dolphins

By: Brokkonaut <hannos17@gmx.de>
This commit is contained in:
CraftBukkit/Spigot
2019-05-17 23:19:52 +02:00
parent 453eb0afe4
commit 4d27af3c76
3 changed files with 31 additions and 14 deletions

View File

@@ -9,7 +9,19 @@
}
@Override
@@ -422,7 +422,7 @@
@@ -178,6 +178,11 @@
ItemStack itemstack = entityitem.getItemStack();
if (this.g(itemstack)) {
+ // CraftBukkit start - call EntityPickupItemEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, entityitem, 0, false).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
this.setSlot(EnumItemSlot.MAINHAND, itemstack);
this.dropChanceHand[EnumItemSlot.MAINHAND.b()] = 2.0F;
this.receive(entityitem, itemstack.getCount());
@@ -422,7 +427,7 @@
@Override
public void c() {
@@ -18,7 +30,7 @@
}
@Override
@@ -441,7 +441,7 @@
@@ -441,7 +446,7 @@
}
if (this.c.isSwimming() && this.c.world.random.nextInt(6) == 0) {