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:
@@ -10,16 +10,6 @@ public class CraftAnimals extends CraftCreature implements Animals {
|
||||
super(server, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CraftAnimals";
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityAnimal getHandle() {
|
||||
return (EntityAnimal) entity;
|
||||
}
|
||||
|
||||
public int getAge() {
|
||||
return getHandle().getAge();
|
||||
}
|
||||
@@ -27,4 +17,14 @@ public class CraftAnimals extends CraftCreature implements Animals {
|
||||
public void setAge(int age) {
|
||||
getHandle().setAge(age);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityAnimal getHandle() {
|
||||
return (EntityAnimal) entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CraftAnimals";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user