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:
@@ -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() + '}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user