Redid existing disguise commands to make em prettier

This commit is contained in:
Andrew
2013-07-16 17:01:32 +12:00
parent dd02b4bcc2
commit 2c652db58b
4 changed files with 222 additions and 189 deletions

View File

@@ -12,15 +12,18 @@ public class UndisguiseCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player p = (Player) sender;
if (sender.getName().equals("CONSOLE")) {
sender.sendMessage(ChatColor.RED + "You may not use this command from the console!");
return true;
}
if (sender.hasPermission("libsdisguises.undisguise")) {
if (DisguiseAPI.isDisguised(p.getName())) {
DisguiseAPI.undisguiseToAll(p);
if (DisguiseAPI.isDisguised(sender.getName())) {
DisguiseAPI.undisguiseToAll((Player) sender);
sender.sendMessage(ChatColor.RED + "You are no longer disguised");
} else
sender.sendMessage(ChatColor.RED + "You are not disguised!");
} else
sender.sendMessage(ChatColor.RED + "You do not have permission to use this command.");
sender.sendMessage(ChatColor.RED + "You are forbidden to use this command!");
return true;
}
}