diff --git a/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java b/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java index f0c37dfc..4602ba77 100644 --- a/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java +++ b/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java @@ -215,6 +215,8 @@ public class DisguiseHelpCommand extends BaseDisguiseCommand { valueType = "number,number,number..."; } else if (c == BlockFace.class) { valueType = "direction"; + } else if (c == RabbitType.class) { + valueType = "rabbit type"; } if (valueType != null) { ChatColor methodColor = ChatColor.YELLOW; diff --git a/src/me/libraryaddict/disguise/disguisetypes/RabbitType.java b/src/me/libraryaddict/disguise/disguisetypes/RabbitType.java index 6fa778a9..b07e4f87 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/RabbitType.java +++ b/src/me/libraryaddict/disguise/disguisetypes/RabbitType.java @@ -1,7 +1,8 @@ package me.libraryaddict.disguise.disguisetypes; public enum RabbitType { - BLACK(2), BLACK_AND_WHITE(3), BROWN(0), GOLD(4), KILLER_BUNNY(99), PEPPER(5), WHITE(1); + BLACK(2), BROWN(0), GOLD(4), KILLER_BUNNY(99), PATCHES(3), PEPPER(5), WHITE(1); + public static RabbitType getType(int id) { for (RabbitType type : values()) { if (type.getTypeId() == id) { diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/ArmorStandWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/ArmorStandWatcher.java index abed6470..49c764b9 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/ArmorStandWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/ArmorStandWatcher.java @@ -8,4 +8,55 @@ public class ArmorStandWatcher extends LivingWatcher { super(disguise); } + private boolean get10(int value) { + return ((Byte) getValue(10, 0) & value) != 0; + } + + public boolean isNoBasePlate() { + return get10(8); + } + + public boolean isNoGravity() { + return get10(2); + } + + public boolean isShowArms() { + return get10(4); + } + + public boolean isSmall() { + return get10(1); + } + + private void set10(int value, boolean isTrue) { + byte b1 = (Byte) getValue(10, (byte) 0); + if (isTrue) + b1 = (byte) (b1 | value); + else { + b1 = (byte) (b1 & value); + } + setValue(10, b1); + sendData(10); + } + + public void setNoBasePlate(boolean noBasePlate) { + set10(8, noBasePlate); + sendData(10); + } + + public void setNoGravity(boolean noGravity) { + set10(2, noGravity); + sendData(10); + } + + public void setShowArms(boolean showArms) { + set10(4, showArms); + sendData(10); + } + + public void setSmall(boolean isSmall) { + set10(1, isSmall); + sendData(10); + } + } diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/GuardianWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/GuardianWatcher.java index 76325774..ad9af212 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/GuardianWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/GuardianWatcher.java @@ -8,8 +8,12 @@ public class GuardianWatcher extends LivingWatcher { super(disguise); } - public void doBeam(boolean doBeam) { - setValue(17, doBeam ? 1 : 0); + public boolean isBeam() { + return (Integer) getValue(17, 0) == 1; + } + + public void setBeam(boolean isBeaming) { + setValue(17, isBeaming ? 1 : 0); sendData(17); } diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/RabbitWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/RabbitWatcher.java index 84bef34f..5c6a7c88 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/RabbitWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/RabbitWatcher.java @@ -1,15 +1,21 @@ package me.libraryaddict.disguise.disguisetypes.watchers; import me.libraryaddict.disguise.disguisetypes.Disguise; +import me.libraryaddict.disguise.disguisetypes.RabbitType; public class RabbitWatcher extends AgeableWatcher { public RabbitWatcher(Disguise disguise) { super(disguise); + setType(RabbitType.values()[RabbitType.values().length]); } - public void setRabbitType(int rabbitType) { - setValue(18, (byte) rabbitType); + public RabbitType getType() { + return RabbitType.getType((Integer) getValue(18, (int) 0)); + } + + public void setType(RabbitType type) { + setValue(18, (byte) type.getTypeId()); sendData(18); } diff --git a/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java b/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java index 741f5009..9bd47717 100644 --- a/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java +++ b/src/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java @@ -603,7 +603,7 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { throw new Exception(); } } catch (Exception ex) { - throw parseToException("rabbit type (white, brown, salt and pepper...)", valueString, methodName); + throw parseToException("rabbit type (white, brown, patches...)", valueString, methodName); } } }