Disguise commands now tell you when they didn't disguise successfully

This commit is contained in:
libraryaddict 2014-06-05 00:26:35 +12:00
parent 956fef9ca1
commit f894b34264
4 changed files with 22 additions and 6 deletions

View File

@ -185,8 +185,13 @@ public class DisguiseListener implements Listener {
} }
} }
} }
if (disguise.isDisguiseInUse()) {
p.sendMessage(ChatColor.RED + "Disguised " + (entity instanceof Player ? "" : "the ") + entityName p.sendMessage(ChatColor.RED + "Disguised " + (entity instanceof Player ? "" : "the ") + entityName
+ " as " + disguiseName + "!"); + " as " + disguiseName + "!");
} else {
p.sendMessage(ChatColor.RED + "Failed to disguise " + (entity instanceof Player ? "" : "the ") + entityName
+ " as " + disguiseName + "!");
}
} }
} else { } else {
if (DisguiseAPI.isDisguised(entity)) { if (DisguiseAPI.isDisguised(entity)) {

View File

@ -42,7 +42,11 @@ public class DisguiseCommand extends BaseDisguiseCommand {
} }
} }
DisguiseAPI.disguiseToAll((Player) sender, disguise); DisguiseAPI.disguiseToAll((Player) sender, disguise);
if (disguise.isDisguiseInUse()) {
sender.sendMessage(ChatColor.RED + "Now disguised as a " + disguise.getType().toReadable()); sender.sendMessage(ChatColor.RED + "Now disguised as a " + disguise.getType().toReadable());
} else {
sender.sendMessage(ChatColor.RED + "Failed to disguise as a " + disguise.getType().toReadable());
}
return true; return true;
} }

View File

@ -64,8 +64,13 @@ public class DisguisePlayerCommand extends BaseDisguiseCommand {
} }
} }
DisguiseAPI.disguiseToAll(player, disguise); DisguiseAPI.disguiseToAll(player, disguise);
if (disguise.isDisguiseInUse()) {
sender.sendMessage(ChatColor.RED + "Successfully disguised " + player.getName() + " as a " sender.sendMessage(ChatColor.RED + "Successfully disguised " + player.getName() + " as a "
+ disguise.getType().toReadable() + "!"); + disguise.getType().toReadable() + "!");
} else {
sender.sendMessage(ChatColor.RED + "Failed to disguise " + player.getName() + " as a "
+ disguise.getType().toReadable() + "!");
}
return true; return true;
} }

View File

@ -119,9 +119,11 @@ public class DisguiseRadiusCommand extends BaseDisguiseCommand {
} }
} }
DisguiseAPI.disguiseToAll(entity, disguise); DisguiseAPI.disguiseToAll(entity, disguise);
if (disguise.isDisguiseInUse()) {
disguisedEntitys++; disguisedEntitys++;
} }
} }
}
if (disguisedEntitys > 0) { if (disguisedEntitys > 0) {
sender.sendMessage(ChatColor.RED + "Successfully disguised " + disguisedEntitys + " entities!"); sender.sendMessage(ChatColor.RED + "Successfully disguised " + disguisedEntitys + " entities!");
} else { } else {