Added setBaby and isBaby to zombiewatcher. Deprecated setadult for ageable and zombie watcher

This commit is contained in:
libraryaddict 2013-12-05 21:21:27 +13:00
parent bd83ff0c80
commit 40694c5030
2 changed files with 13 additions and 1 deletions

View File

@ -12,6 +12,7 @@ public class AgeableWatcher extends LivingWatcher {
return (Integer) getValue(12, 0); return (Integer) getValue(12, 0);
} }
@Deprecated
public boolean isAdult() { public boolean isAdult() {
return !isBaby(); return !isBaby();
} }
@ -20,6 +21,7 @@ public class AgeableWatcher extends LivingWatcher {
return (Integer) getValue(12, 0) < 0; return (Integer) getValue(12, 0) < 0;
} }
@Deprecated
public void setAdult(boolean isAdult) { public void setAdult(boolean isAdult) {
setBaby(!isAdult); setBaby(!isAdult);
} }

View File

@ -8,16 +8,26 @@ public class ZombieWatcher extends LivingWatcher {
super(disguise); super(disguise);
} }
@Deprecated
public boolean isAdult() { public boolean isAdult() {
return (Byte) getValue(12, (byte) 0) == 0; return (Byte) getValue(12, (byte) 0) == 0;
} }
public boolean isBaby() {
return (Byte) getValue(12, (byte) 0) == 1;
}
public boolean isVillager() { public boolean isVillager() {
return (Byte) getValue(13, (byte) 0) == 1; return (Byte) getValue(13, (byte) 0) == 1;
} }
@Deprecated
public void setAdult(boolean adult) { public void setAdult(boolean adult) {
setValue(12, (byte) (adult ? 0 : 1)); setBaby(!adult);
}
public void setBaby(boolean baby) {
setValue(12, (byte) (baby ? 1 : 0));
sendData(12); sendData(12);
} }