2013-09-25 16:49:24 +02:00
|
|
|
package me.libraryaddict.disguise.commands;
|
|
|
|
|
2013-05-29 00:44:55 +02:00
|
|
|
import me.libraryaddict.disguise.DisguiseAPI;
|
|
|
|
|
|
|
|
import org.bukkit.Bukkit;
|
|
|
|
import org.bukkit.ChatColor;
|
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandExecutor;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
public class UndisguisePlayerCommand implements CommandExecutor {
|
|
|
|
|
2013-05-29 00:52:54 +02:00
|
|
|
@Override
|
2013-05-29 00:44:55 +02:00
|
|
|
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
2013-07-16 07:37:31 +02:00
|
|
|
if (sender.hasPermission("libsdisguises.undisguiseplayer")) {
|
2013-05-29 00:44:55 +02:00
|
|
|
if (args.length > 0) {
|
|
|
|
Player p = Bukkit.getPlayer(args[0]);
|
|
|
|
if (p != null) {
|
2013-07-21 05:17:21 +02:00
|
|
|
if (DisguiseAPI.isDisguised(p)) {
|
2013-05-29 00:44:55 +02:00
|
|
|
DisguiseAPI.undisguiseToAll(p);
|
2014-01-18 02:23:27 +01:00
|
|
|
sender.sendMessage(ChatColor.RED + "The player is no longer disguised");
|
2015-08-03 00:39:44 +02:00
|
|
|
} else {
|
2014-01-18 02:23:27 +01:00
|
|
|
sender.sendMessage(ChatColor.RED + "The player is not disguised!");
|
2015-08-03 00:39:44 +02:00
|
|
|
}
|
|
|
|
} else {
|
2013-05-29 00:52:10 +02:00
|
|
|
sender.sendMessage(ChatColor.RED + "Player not found");
|
2015-08-03 00:39:44 +02:00
|
|
|
}
|
|
|
|
} else {
|
2013-05-29 00:44:55 +02:00
|
|
|
sender.sendMessage(ChatColor.RED + "/undisguiseplayer <Name>");
|
2015-08-03 00:39:44 +02:00
|
|
|
}
|
|
|
|
} else {
|
2014-06-01 17:52:54 +02:00
|
|
|
sender.sendMessage(ChatColor.RED + "You are forbidden to use this command.");
|
2015-08-03 00:39:44 +02:00
|
|
|
}
|
2013-05-29 00:44:55 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|