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:
Andrew Ardill
2011-11-29 21:22:35 +11:00
parent a51eb9c3ca
commit 2759809ecb
57 changed files with 588 additions and 305 deletions

View File

@@ -51,21 +51,6 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return getHandle().getMaxHealth();
}
@Override
public EntityLiving getHandle() {
return (EntityLiving) entity;
}
public void setHandle(final EntityLiving entity) {
super.setHandle((Entity) entity);
this.entity = entity;
}
@Override
public String toString() {
return "CraftLivingEntity{" + "id=" + getEntityId() + '}';
}
public Egg throwEgg() {
net.minecraft.server.World world = ((CraftWorld) getWorld()).getHandle();
EntityEgg egg = new EntityEgg(world, getHandle());
@@ -224,4 +209,18 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public void setNoDamageTicks(int ticks) {
getHandle().noDamageTicks = ticks;
}
@Override
public EntityLiving getHandle() {
return (EntityLiving) entity;
}
public void setHandle(final EntityLiving entity) {
super.setHandle(entity);
}
@Override
public String toString() {
return "CraftLivingEntity{" + "id=" + getEntityId() + '}';
}
}