[Bleeding] Allow CraftItem to be backed by non-EntityItems. Fixes BUKKIT-1351

By: feildmaster <admin@feildmaster.com>
This commit is contained in:
CraftBukkit/Spigot 2012-03-25 20:58:12 -05:00
parent ae4b2591f7
commit 0ebe730fce

View File

@ -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";