Fix Craft Entity constructors and toStrings.
Also, standardise getHandle and clean up in general. getHandle is now using the 'entity' member variable instead of super.getHandle, as this reduces the number of chained calls needed.
This commit is contained in:
@@ -31,17 +31,6 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
return getHandle().name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityHuman getHandle() {
|
||||
return (EntityHuman) entity;
|
||||
}
|
||||
|
||||
public void setHandle(final EntityHuman entity) {
|
||||
super.setHandle((EntityHuman) entity);
|
||||
this.entity = entity;
|
||||
this.inventory = new CraftInventoryPlayer(entity.inventory);
|
||||
}
|
||||
|
||||
public PlayerInventory getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
@@ -54,11 +43,6 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
getInventory().setItemInHand(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CraftHumanEntity{" + "id=" + getEntityId() + "name=" + getName() + '}';
|
||||
}
|
||||
|
||||
public boolean isSleeping() {
|
||||
return getHandle().sleeping;
|
||||
}
|
||||
@@ -131,4 +115,19 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityHuman getHandle() {
|
||||
return (EntityHuman) entity;
|
||||
}
|
||||
|
||||
public void setHandle(final EntityHuman entity) {
|
||||
super.setHandle(entity);
|
||||
this.inventory = new CraftInventoryPlayer(entity.inventory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CraftHumanEntity{" + "id=" + getEntityId() + "name=" + getName() + '}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user