2013-05-29 00:44:55 +02:00
|
|
|
package me.libraryaddict.disguise.Commands;
|
|
|
|
|
|
|
|
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);
|
|
|
|
sender.sendMessage(ChatColor.RED + "He is no longer disguised");
|
|
|
|
} else
|
|
|
|
sender.sendMessage(ChatColor.RED + "He is not disguised!");
|
2013-05-29 00:52:10 +02:00
|
|
|
} else
|
|
|
|
sender.sendMessage(ChatColor.RED + "Player not found");
|
2013-05-29 00:44:55 +02:00
|
|
|
} else
|
|
|
|
sender.sendMessage(ChatColor.RED + "/undisguiseplayer <Name>");
|
|
|
|
} else
|
2013-07-16 07:01:32 +02:00
|
|
|
sender.sendMessage(ChatColor.RED + "You are forbidden to use this command!");
|
2013-05-29 00:44:55 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|