From 0db94d4fcac2715f70b221eabfdcbd70bd13332d Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 21 Oct 2018 14:39:21 -0500 Subject: [PATCH] Fix #1604 (#1605) --- ...s-and-setters-for-EntityItem-owner-a.patch | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/Spigot-Server-Patches/0395-Implement-getters-and-setters-for-EntityItem-owner-a.patch b/Spigot-Server-Patches/0395-Implement-getters-and-setters-for-EntityItem-owner-a.patch index 75a2c1871d..bcfaff5071 100644 --- a/Spigot-Server-Patches/0395-Implement-getters-and-setters-for-EntityItem-owner-a.patch +++ b/Spigot-Server-Patches/0395-Implement-getters-and-setters-for-EntityItem-owner-a.patch @@ -1,4 +1,4 @@ -From 1d1165741a3b4814b84517f53a18d5e46bb1845a Mon Sep 17 00:00:00 2001 +From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 6 Oct 2018 20:54:23 -0500 Subject: [PATCH] Implement getters and setters for EntityItem owner and @@ -6,7 +6,7 @@ Subject: [PATCH] Implement getters and setters for EntityItem owner and diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index f596b435..67b29c55 100644 +index 7ac07ac07ac0..7ac07ac07ac0 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -410,20 +410,22 @@ public class EntityItem extends Entity { @@ -37,7 +37,7 @@ index f596b435..67b29c55 100644 this.f = uuid; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -index 1df17f09..3da71da5 100644 +index 7ac07ac07ac0..7ac07ac07ac0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java @@ -9,6 +9,11 @@ import org.bukkit.inventory.ItemStack; @@ -52,41 +52,27 @@ index 1df17f09..3da71da5 100644 public class CraftItem extends CraftEntity implements Item { private final EntityItem item; -@@ -21,6 +26,13 @@ public class CraftItem extends CraftEntity implements Item { - this(server, entity, entity); - } - -+ // Paper start -+ @Override -+ public EntityItem getHandle() { -+ return (EntityItem) entity; -+ } -+ // Paper end -+ - public ItemStack getItemStack() { - return CraftItemStack.asCraftMirror(item.getItemStack()); - } -@@ -45,6 +57,24 @@ public class CraftItem extends CraftEntity implements Item { +@@ -45,6 +50,24 @@ public class CraftItem extends CraftEntity implements Item { public void setCanMobPickup(boolean canMobPickup) { item.canMobPickup = canMobPickup; } + + @Nullable + public UUID getOwner() { -+ return getHandle().getOwner(); ++ return item.getOwner(); + } + + public void setOwner(@Nullable UUID owner) { -+ getHandle().setOwner(owner); ++ item.setOwner(owner); + } + + @Nullable + public UUID getThrower() { -+ return getHandle().getThrower(); ++ return item.getThrower(); + } + + public void setThrower(@Nullable UUID thrower) { -+ getHandle().setThrower(thrower); ++ item.setThrower(thrower); + } // Paper End