LibsDisguises/src/me/libraryaddict/disguise/Commands/UndisguisePlayerCommand.java
Andrew 59588f5270 Read desc
Now use Entitys completely for the disguising.
Now removes the disguise when the entity isn't valid.
Deprecated the methods using a object.
Added methods to set and get velocity - If packets should be sent.
2013-07-21 15:17:21 +12:00

34 lines
1.3 KiB
Java

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 {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender.hasPermission("libsdisguises.undisguiseplayer")) {
if (args.length > 0) {
Player p = Bukkit.getPlayer(args[0]);
if (p != null) {
if (DisguiseAPI.isDisguised(p)) {
DisguiseAPI.undisguiseToAll(p);
sender.sendMessage(ChatColor.RED + "He is no longer disguised");
} else
sender.sendMessage(ChatColor.RED + "He is not disguised!");
} else
sender.sendMessage(ChatColor.RED + "Player not found");
} else
sender.sendMessage(ChatColor.RED + "/undisguiseplayer <Name>");
} else
sender.sendMessage(ChatColor.RED + "You are forbidden to use this command!");
return true;
}
}