From db4dea8fc1d501d4fb9b876675a56788fe29f05e Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 5 May 2017 01:16:22 -0500 Subject: [PATCH] EntityPickupItemEvent diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java index a7bee79b8..a93c00014 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -10,8 +10,11 @@ import java.util.UUID; import javax.annotation.Nullable; // CraftBukkit start +import org.bukkit.craftbukkit.entity.CraftItem; import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.entity.CraftLivingEntity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.event.entity.EntityPickupItemEvent; import org.bukkit.event.entity.EntityTargetLivingEntityEvent; import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.event.entity.EntityUnleashEvent; @@ -568,6 +571,16 @@ public abstract class EntityInsentient extends EntityLiving { } if (flag && this.c(itemstack)) { + + // Paper Start + EntityPickupItemEvent event = new EntityPickupItemEvent((LivingEntity) this.getBukkitEntity(), new CraftItem(this.world.getServer(), entityitem)); + this.world.getServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return; + } + // Paper end + double d0; switch (enumitemslot.a()) { -- 2.13.1