From 0ebe730fce33a9b7814d71dbea44b868ba9930dc Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 25 Mar 2012 20:58:12 -0500 Subject: [PATCH] [Bleeding] Allow CraftItem to be backed by non-EntityItems. Fixes BUKKIT-1351 By: feildmaster --- .../org/bukkit/craftbukkit/entity/CraftItem.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java index 36143dbaf9..1612cc4be6 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.entity; +import net.minecraft.server.Entity; import net.minecraft.server.EntityItem; import org.bukkit.entity.EntityType; @@ -11,9 +12,13 @@ import org.bukkit.craftbukkit.CraftServer; public class CraftItem extends CraftEntity implements Item { private EntityItem item; - public CraftItem(CraftServer server, EntityItem entity) { + public CraftItem(CraftServer server, Entity entity, EntityItem item) { super(server, entity); - this.item = entity; + this.item = item; + } + + public CraftItem(CraftServer server, EntityItem entity) { + this(server, entity, entity); } public ItemStack getItemStack() { @@ -32,11 +37,6 @@ public class CraftItem extends CraftEntity implements Item { item.pickupDelay = delay; } - @Override - public EntityItem getHandle() { - return (EntityItem) entity; - } - @Override public String toString() { return "CraftItem";