From 40694c50304fe883f4e20d88e28c3c2ef46966ef Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 5 Dec 2013 21:21:27 +1300 Subject: [PATCH] Added setBaby and isBaby to zombiewatcher. Deprecated setadult for ageable and zombie watcher --- .../disguisetypes/watchers/AgeableWatcher.java | 2 ++ .../disguisetypes/watchers/ZombieWatcher.java | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/AgeableWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/AgeableWatcher.java index 731de581..ad320608 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/AgeableWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/AgeableWatcher.java @@ -12,6 +12,7 @@ public class AgeableWatcher extends LivingWatcher { return (Integer) getValue(12, 0); } + @Deprecated public boolean isAdult() { return !isBaby(); } @@ -20,6 +21,7 @@ public class AgeableWatcher extends LivingWatcher { return (Integer) getValue(12, 0) < 0; } + @Deprecated public void setAdult(boolean isAdult) { setBaby(!isAdult); } diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/ZombieWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/ZombieWatcher.java index f96e40c6..97d44a11 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/ZombieWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/ZombieWatcher.java @@ -8,16 +8,26 @@ public class ZombieWatcher extends LivingWatcher { super(disguise); } + @Deprecated public boolean isAdult() { return (Byte) getValue(12, (byte) 0) == 0; } + public boolean isBaby() { + return (Byte) getValue(12, (byte) 0) == 1; + } + public boolean isVillager() { return (Byte) getValue(13, (byte) 0) == 1; } + @Deprecated 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); }