SPIGOT-4964: EntityPickupItemEvent for pandas

This commit is contained in:
md_5 2019-05-20 19:54:24 +10:00
parent de9b85b8a1
commit 49e15b4d9a

View File

@ -9,6 +9,15 @@
public class EntityPanda extends EntityAnimal { public class EntityPanda extends EntityAnimal {
private static final DataWatcherObject<Integer> bA = DataWatcher.a(EntityPanda.class, DataWatcherRegistry.b); private static final DataWatcherObject<Integer> bA = DataWatcher.a(EntityPanda.class, DataWatcherRegistry.b);
@@ -445,7 +447,7 @@
@Override
protected void a(EntityItem entityitem) {
- if (this.getEquipment(EnumItemSlot.MAINHAND).isEmpty() && EntityPanda.bQ.test(entityitem)) {
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, entityitem, 0, !(this.getEquipment(EnumItemSlot.MAINHAND).isEmpty() && EntityPanda.bQ.test(entityitem))).isCancelled()) { // CraftBukkit
ItemStack itemstack = entityitem.getItemStack();
this.setSlot(EnumItemSlot.MAINHAND, itemstack);
@@ -673,7 +675,7 @@ @@ -673,7 +675,7 @@
@Override @Override
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) { protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {