Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.natmanu.net;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import JSON.JSONChatClickEventTipo.JSONChatClickEventType;
- import JSON.JSONChatExtras;
- import JSON.JSONChatHoverEventTipo.JSONChatHoverEventType;
- import JSON.JSONChatMessage;
- public class Comandos implements CommandExecutor {
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- if(sender instanceof Player) {
- if (cmd.getName().equalsIgnoreCase("manu")) {
- if (args.length != 1) {
- JSONChatMessage texto = new JSONChatMessage(" ", null, null);
- JSONChatExtras um = new JSONChatExtras("\n");
- JSONChatExtras dois = new JSONChatExtras("\n");
- JSONChatExtras tres = new JSONChatExtras("\n");
- JSONChatExtras ativar = new JSONChatExtras("§e /manu ativar");
- ativar.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu ativar \n§7 Clique para ativar o modo manutenção do servidor!");
- ativar.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "/manu ativar");
- JSONChatExtras desativar = new JSONChatExtras("§e\n§e /manu desativar");
- desativar.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu desativar \n§7 Clique para desativar o modo manutenção do servidor!");
- desativar.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "/manu desativar");
- JSONChatExtras tempo = new JSONChatExtras("§e\n§e /manu tempo (segundos) [V2]");
- tempo.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu tempo (segundos) \n §7Disponivel na V2...");
- tempo.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "Em breve...");
- JSONChatExtras cancelartempo = new JSONChatExtras("§e\n§e /manu cancelar [V2]");
- cancelartempo.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu cancelar \n §7Disponivel na V2...");
- cancelartempo.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "Em breve...");
- texto.addExtra(dois);
- texto.addExtra(ativar);
- texto.addExtra(desativar);
- texto.addExtra(um);
- texto.addExtra(tempo);
- texto.addExtra(cancelartempo);
- texto.addExtra(tres);
- texto.sendToPlayer((Player) sender);
- return true;
- }
- if(!args[0].equalsIgnoreCase("ativar") && !args[0].equalsIgnoreCase("desativar")) {
- if(!args[0].equalsIgnoreCase(null)) {
- JSONChatMessage texto = new JSONChatMessage(" ", null, null);
- JSONChatExtras um = new JSONChatExtras("\n");
- JSONChatExtras dois = new JSONChatExtras("\n");
- JSONChatExtras tres = new JSONChatExtras("\n");
- JSONChatExtras ativar = new JSONChatExtras("§e /manu ativar");
- ativar.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu ativar \n§7 Clique para ativar o modo manutenção do servidor!");
- ativar.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "/manu ativar");
- JSONChatExtras desativar = new JSONChatExtras("§e\n§e /manu desativar");
- desativar.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu desativar \n§7 Clique para desativar o modo manutenção do servidor!");
- desativar.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "/manu desativar");
- JSONChatExtras tempo = new JSONChatExtras("§e\n§e /manu tempo (segundos) [V2]");
- tempo.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu tempo (segundos) \n §7Disponivel na V2...");
- tempo.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "Em breve...");
- JSONChatExtras cancelartempo = new JSONChatExtras("§e\n§e /manu cancelar [V2]");
- cancelartempo.setHoverEvent(JSONChatHoverEventType.SHOW_TEXT, "§e/manu cancelar \n §7Disponivel na V2...");
- cancelartempo.setClickEvent(JSONChatClickEventType.SUGGEST_COMMAND, "Em breve...");
- texto.addExtra(dois);
- texto.addExtra(ativar);
- texto.addExtra(desativar);
- texto.addExtra(um);
- texto.addExtra(tempo);
- texto.addExtra(cancelartempo);
- texto.addExtra(tres);
- texto.sendToPlayer((Player) sender);
- return true;
- }
- }
- if (args[0].equalsIgnoreCase("ativar")) {
- if(Utilidades.manu==true) {
- sender.sendMessage("§cO modo manutenção já está ativado!");
- return true;
- }else {
- Utilidades.manu=true;
- sender.sendMessage("§eVocê ativou o modo manutenção!");
- return true;
- }
- }
- else if (args[0].equalsIgnoreCase("desativar")) {
- if(Utilidades.manu==false) {
- sender.sendMessage("§cModo manutenção já está desativado!");
- return true;
- }else {
- Utilidades.manu=false;
- sender.sendMessage("§eVocê desativou o modo manutenção!");
- return true;
- }
- }
- }else {
- if (cmd.getName().equalsIgnoreCase("manu")) {
- if (args.length != 1) {
- sender.sendMessage("");
- sender.sendMessage("§e /manu ativar");
- sender.sendMessage("§e /manu desativar");
- sender.sendMessage("");
- sender.sendMessage("§e /manu tempo (segundos) [V2]");
- sender.sendMessage("§e /manu cancelar [V2]");
- sender.sendMessage("");
- return true;
- }
- if(!args[0].equalsIgnoreCase("ativar") && !args[0].equalsIgnoreCase("desativar")) {
- if(!args[0].equalsIgnoreCase(null)) {
- sender.sendMessage("");
- sender.sendMessage("§e /manu ativar");
- sender.sendMessage("§e /manu desativar");
- sender.sendMessage("");
- sender.sendMessage("§e /manu tempo (segundos) [V2]");
- sender.sendMessage("§e /manu cancelar [V2]");
- sender.sendMessage("");
- return true;
- }
- if(!args[0].equalsIgnoreCase("ativar") && !args[0].equalsIgnoreCase("desativar")) {
- if(!args[2].equalsIgnoreCase(null)) {
- sender.sendMessage("");
- sender.sendMessage("§e /manu ativar");
- sender.sendMessage("§e /manu desativar");
- sender.sendMessage("");
- sender.sendMessage("§e /manu tempo (segundos) [V2]");
- sender.sendMessage("§e /manu cancelar [V2]");
- sender.sendMessage("");
- return true;
- }
- if (args[0].equalsIgnoreCase("ativar")) {
- if(Utilidades.manu==true) {
- sender.sendMessage("§cO modo manutenção já está ativado!");
- return true;
- }else {
- Utilidades.manu=true;
- sender.sendMessage("§eVocê ativou o modo manutenção!");
- return true;
- }
- }
- else if (args[0].equalsIgnoreCase("desativar")) {
- if(Utilidades.manu==false) {
- sender.sendMessage("§cModo manutenção já está desativado!");
- return true;
- }else {
- Utilidades.manu=false;
- sender.sendMessage("§eVocê desativou o modo manutenção!");
- return true;
- }
- }
- }
- }
- }
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement