2010-12-30 05:30:12 +01:00
|
|
|
|
|
|
|
package org.bukkit.craftbukkit;
|
|
|
|
|
|
|
|
import net.minecraft.server.EntityPlayer;
|
|
|
|
import net.minecraft.server.InventoryPlayer;
|
|
|
|
import org.bukkit.HumanEntity;
|
|
|
|
import org.bukkit.ItemStack;
|
|
|
|
|
|
|
|
public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
2010-12-30 21:34:26 +01:00
|
|
|
private EntityPlayer entity;
|
2010-12-30 05:30:12 +01:00
|
|
|
|
|
|
|
public CraftHumanEntity(final CraftServer server, final EntityPlayer entity) {
|
|
|
|
super(server, entity);
|
|
|
|
this.entity = entity;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ItemStack getSelectedItem() {
|
|
|
|
// TODO: Implement inventories
|
|
|
|
final InventoryPlayer inventory = entity.an;
|
|
|
|
return new ItemStack(inventory.e().c, inventory.e().a);
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getName() {
|
|
|
|
return entity.aw;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public EntityPlayer getHandle() {
|
|
|
|
return entity;
|
|
|
|
}
|
|
|
|
|
2010-12-30 21:34:26 +01:00
|
|
|
public void setHandle(final EntityPlayer entity) {
|
|
|
|
super.setHandle((EntityPlayer)entity);
|
|
|
|
this.entity = entity;
|
|
|
|
}
|
|
|
|
|
2010-12-30 05:30:12 +01:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "CraftHumanEntity{" + "id=" + getEntityID() + "name=" + getName() + '}';
|
|
|
|
}
|
|
|
|
}
|