From a48db82eb916dfcba0356f14d968356032a4d51f Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 6 Nov 2013 04:51:01 +1300 Subject: [PATCH] Fix a bug in the setting a adult --- src/me/libraryaddict/disguise/BaseDisguiseCommand.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/me/libraryaddict/disguise/BaseDisguiseCommand.java b/src/me/libraryaddict/disguise/BaseDisguiseCommand.java index ab0b447e..9323ef0c 100644 --- a/src/me/libraryaddict/disguise/BaseDisguiseCommand.java +++ b/src/me/libraryaddict/disguise/BaseDisguiseCommand.java @@ -82,23 +82,21 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { // Time to start constructing the disguise. // We will need to check between all 3 kinds of disguises if (disguiseType.isPlayer()) {// If he is doing a player disguise - toSkip++; if (args.length == 1) { // He needs to give the player name throw new Exception(ChatColor.RED + "Error! You need to give a player name!"); } else { // Construct the player disguise disguise = new PlayerDisguise(ChatColor.translateAlternateColorCodes('&', args[1])); + toSkip++; } } else { if (disguiseType.isMob()) { // Its a mob, use the mob constructor boolean adult = true; if (args.length > 1) { - try { - adult = Boolean.valueOf(args[1]); + if (args[1].equalsIgnoreCase("true") || args[1].equalsIgnoreCase("false")) { + adult = "false".equalsIgnoreCase(args[1]); toSkip++; - } catch (Exception ex) { - // Its not a true/false for adult.. } } disguise = new MobDisguise(disguiseType, adult);