Fix a bug in the setting a adult
This commit is contained in:
parent
4596752c29
commit
a48db82eb9
@ -82,23 +82,21 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
|
|||||||
// Time to start constructing the disguise.
|
// Time to start constructing the disguise.
|
||||||
// We will need to check between all 3 kinds of disguises
|
// We will need to check between all 3 kinds of disguises
|
||||||
if (disguiseType.isPlayer()) {// If he is doing a player disguise
|
if (disguiseType.isPlayer()) {// If he is doing a player disguise
|
||||||
toSkip++;
|
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
// He needs to give the player name
|
// He needs to give the player name
|
||||||
throw new Exception(ChatColor.RED + "Error! You need to give a player name!");
|
throw new Exception(ChatColor.RED + "Error! You need to give a player name!");
|
||||||
} else {
|
} else {
|
||||||
// Construct the player disguise
|
// Construct the player disguise
|
||||||
disguise = new PlayerDisguise(ChatColor.translateAlternateColorCodes('&', args[1]));
|
disguise = new PlayerDisguise(ChatColor.translateAlternateColorCodes('&', args[1]));
|
||||||
|
toSkip++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (disguiseType.isMob()) { // Its a mob, use the mob constructor
|
if (disguiseType.isMob()) { // Its a mob, use the mob constructor
|
||||||
boolean adult = true;
|
boolean adult = true;
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
try {
|
if (args[1].equalsIgnoreCase("true") || args[1].equalsIgnoreCase("false")) {
|
||||||
adult = Boolean.valueOf(args[1]);
|
adult = "false".equalsIgnoreCase(args[1]);
|
||||||
toSkip++;
|
toSkip++;
|
||||||
} catch (Exception ex) {
|
|
||||||
// Its not a true/false for adult..
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
disguise = new MobDisguise(disguiseType, adult);
|
disguise = new MobDisguise(disguiseType, adult);
|
||||||
|
Loading…
Reference in New Issue
Block a user