When using disguise command. 'p' is a subsitute for player

This commit is contained in:
libraryaddict 2014-04-12 05:31:46 +12:00
parent 684d996754
commit d53a34f5e4

View File

@ -134,15 +134,19 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
throw new Exception(); throw new Exception();
} }
DisguiseType disguiseType = null; DisguiseType disguiseType = null;
if (args[0].equalsIgnoreCase("p")) {
disguiseType = DisguiseType.PLAYER;
} else {
for (DisguiseType type : DisguiseType.values()) { for (DisguiseType type : DisguiseType.values()) {
if (type.getEntityType() == null) { if (type.getEntityType() == null) {
continue; continue;
} }
if (args[0].equalsIgnoreCase(type.name()) || type.name().replace("_", "").equalsIgnoreCase(args[0])) { if (args[0].equalsIgnoreCase(type.name()) || args[0].equalsIgnoreCase(type.name().replace("_", ""))) {
disguiseType = type; disguiseType = type;
break; break;
} }
} }
}
if (disguiseType == null) { if (disguiseType == null) {
throw new Exception(ChatColor.RED + "Error! The disguise " + ChatColor.GREEN + args[0] + ChatColor.RED throw new Exception(ChatColor.RED + "Error! The disguise " + ChatColor.GREEN + args[0] + ChatColor.RED
+ " doesn't exist!"); + " doesn't exist!");