2017-06-12 01:02:57 +00:00
|
|
|
From db4dea8fc1d501d4fb9b876675a56788fe29f05e Mon Sep 17 00:00:00 2001
|
2017-06-12 00:42:01 +00:00
|
|
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
|
|
|
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
|
2017-06-12 01:02:57 +00:00
|
|
|
index a7bee79b8..a93c00014 100644
|
2017-06-12 00:42:01 +00:00
|
|
|
--- 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;
|
2017-06-12 01:02:57 +00:00
|
|
|
@@ -568,6 +571,16 @@ public abstract class EntityInsentient extends EntityLiving {
|
2017-06-12 00:42:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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()) {
|
|
|
|
--
|
2017-06-12 01:02:57 +00:00
|
|
|
2.13.1
|
2017-06-12 00:42:01 +00:00
|
|
|
|