From 7c12b2e0b3f708ccd50e63da54d0d5cab45f556a Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 24 May 2014 05:18:24 +1200 Subject: [PATCH] Did I screw up isAdult.. Huh --- .../disguise/disguisetypes/FlagWatcher.java | 9 ++++++--- .../disguise/disguisetypes/MobDisguise.java | 14 ++++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java index 9ffde0c0..ca33d3d3 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java @@ -267,8 +267,9 @@ public class FlagWatcher { } public void setArmor(ItemStack[] itemstack) { - for (int i = 0; i < itemstack.length; i++) + for (int i = 0; i < itemstack.length; i++) { setItemStack(i, itemstack[i]); + } } protected void setBackupValue(int no, Object value) { @@ -310,14 +311,16 @@ public class FlagWatcher { } else { itemStack = enquipment.getArmorContents()[slot]; } - if (itemStack != null && itemStack.getTypeId() == 0) + if (itemStack != null && itemStack.getTypeId() == 0) { itemStack = null; + } } } Object itemToSend = null; - if (itemStack != null && itemStack.getTypeId() != 0) + if (itemStack != null && itemStack.getTypeId() != 0) { itemToSend = ReflectionManager.getNmsItem(itemStack); + } items[slot] = itemStack; if (DisguiseAPI.isDisguiseInUse(getDisguise())) { slot++; diff --git a/src/me/libraryaddict/disguise/disguisetypes/MobDisguise.java b/src/me/libraryaddict/disguise/disguisetypes/MobDisguise.java index e1b3c3c5..9311e467 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/MobDisguise.java +++ b/src/me/libraryaddict/disguise/disguisetypes/MobDisguise.java @@ -18,7 +18,8 @@ public class MobDisguise extends TargetedDisguise { public MobDisguise(DisguiseType disguiseType, boolean isAdult) { if (!disguiseType.isMob()) { throw new InvalidParameterException("Expected a living DisguiseType while constructing MobDisguise. Received " - + disguiseType + " instead. Please use " + (disguiseType.isPlayer() ? "PlayerDisguise" : "MiscDisguise") + " instead"); + + disguiseType + " instead. Please use " + (disguiseType.isPlayer() ? "PlayerDisguise" : "MiscDisguise") + + " instead"); } this.isAdult = isAdult; createDisguise(disguiseType); @@ -70,11 +71,12 @@ public class MobDisguise extends TargetedDisguise { public boolean isAdult() { if (getWatcher() != null) { - if (getWatcher() instanceof AgeableWatcher) - return ((AgeableWatcher) getWatcher()).isBaby(); - else if (getWatcher() instanceof ZombieWatcher) - return ((ZombieWatcher) getWatcher()).isBaby(); - return false; + if (getWatcher() instanceof AgeableWatcher) { + return ((AgeableWatcher) getWatcher()).isAdult(); + } else if (getWatcher() instanceof ZombieWatcher) { + return ((ZombieWatcher) getWatcher()).isAdult(); + } + return true; } return isAdult; }