Current work

This commit is contained in:
libraryaddict
2017-06-19 21:23:02 +12:00
parent f4bc7ef3a4
commit cba8cb417c
24 changed files with 622 additions and 486 deletions

View File

@@ -1,5 +1,6 @@
package me.libraryaddict.disguise.commands;
import me.libraryaddict.disguise.utilities.TranslateType;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@@ -9,32 +10,24 @@ import org.bukkit.entity.Player;
import me.libraryaddict.disguise.DisguiseAPI;
public class UndisguiseCommand implements CommandExecutor
{
public class UndisguiseCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
{
if (sender.getName().equals("CONSOLE"))
{
sender.sendMessage(ChatColor.RED + "You may not use this command from the console!");
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender.getName().equals("CONSOLE")) {
sender.sendMessage(
TranslateType.MESSAGE.get(ChatColor.RED + "You may not use this command from the " + "console!"));
return true;
}
if (sender.hasPermission("libsdisguises.undisguise"))
{
if (DisguiseAPI.isDisguised((Entity) sender))
{
if (sender.hasPermission("libsdisguises.undisguise")) {
if (DisguiseAPI.isDisguised((Entity) sender)) {
DisguiseAPI.undisguiseToAll((Player) sender);
sender.sendMessage(ChatColor.RED + "You are no longer disguised");
sender.sendMessage(TranslateType.MESSAGE.get(ChatColor.RED + "You are no longer disguised"));
} else {
sender.sendMessage(TranslateType.MESSAGE.get(ChatColor.RED + "You are not disguised!"));
}
else
{
sender.sendMessage(ChatColor.RED + "You are not disguised!");
}
}
else
{
sender.sendMessage(ChatColor.RED + "You are forbidden to use this command.");
} else {
sender.sendMessage(TranslateType.MESSAGE.get(ChatColor.RED + "You are forbidden to use this command."));
}
return true;
}