mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +01:00
[Bleeding] Allow CraftItem to be backed by non-EntityItems. Fixes BUKKIT-1351
By: feildmaster <admin@feildmaster.com>
This commit is contained in:
parent
ae4b2591f7
commit
0ebe730fce
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user