Did I screw up isAdult.. Huh

This commit is contained in:
libraryaddict 2014-05-24 05:18:24 +12:00
parent 19aabb2656
commit 7c12b2e0b3
2 changed files with 14 additions and 9 deletions

View File

@ -267,9 +267,10 @@ 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) {
backupEntityValues.put(no, 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++;

View File

@ -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;
}