LibsDisguises/src/me/libraryaddict/disguise/commands/DisguiseViewSelfCommand.java

37 lines
1.1 KiB
Java
Raw Normal View History

package me.libraryaddict.disguise.commands;
2017-06-19 19:06:35 +02:00
import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.utilities.LibsMsg;
2017-06-19 11:23:02 +02:00
import me.libraryaddict.disguise.utilities.TranslateType;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
* @author Navid
*/
2016-11-28 22:47:48 +01:00
public class DisguiseViewSelfCommand implements CommandExecutor {
@Override
2016-11-28 15:01:06 +01:00
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender.getName().equals("CONSOLE")) {
2017-06-19 19:06:35 +02:00
sender.sendMessage(LibsMsg.NO_CONSOLE.get());
return true;
}
2016-11-28 15:01:06 +01:00
Player player = (Player) sender;
2016-11-28 15:01:06 +01:00
if (DisguiseAPI.isViewSelfToggled(player)) {
DisguiseAPI.setViewDisguiseToggled(player, false);
2017-06-19 19:06:35 +02:00
sender.sendMessage(LibsMsg.VIEW_SELF_ON.get());
2017-06-19 11:23:02 +02:00
} else {
DisguiseAPI.setViewDisguiseToggled(player, true);
2017-06-19 19:06:35 +02:00
sender.sendMessage(LibsMsg.VIEW_SELF_OFF.get());
}
2016-11-28 15:01:06 +01:00
return true;
}
}