2017-06-19 03:36:55 +02:00
|
|
|
From 2bd8b2b7e764e6e93fe7ac9d037d65f240bf915a Mon Sep 17 00:00:00 2001
|
2017-06-12 02:42:01 +02: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-19 03:36:55 +02:00
|
|
|
index a7bee79b..a93c0001 100644
|
2017-06-12 02:42:01 +02: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 03:02:57 +02:00
|
|
|
@@ -568,6 +571,16 @@ public abstract class EntityInsentient extends EntityLiving {
|
2017-06-12 02:42:01 +02: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-19 03:36:55 +02:00
|
|
|
2.13.1.windows.2
|
2017-06-12 02:42:01 +02:00
|
|
|
|