Guest User

Main.java

a guest
Jul 9th, 2015
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 33.79 KB | None | 0 0
  1. package net.wandnetwork;
  2.  
  3. import java.util.HashMap;
  4.  
  5. import org.bukkit.Bukkit;
  6. import org.bukkit.ChatColor;
  7. import org.bukkit.Color;
  8. import org.bukkit.Effect;
  9. import org.bukkit.FireworkEffect;
  10. import org.bukkit.GameMode;
  11. import org.bukkit.Location;
  12. import org.bukkit.Material;
  13. import org.bukkit.Sound;
  14. import org.bukkit.World;
  15. import org.bukkit.FireworkEffect.Type;
  16. import org.bukkit.command.Command;
  17. import org.bukkit.command.CommandSender;
  18. import org.bukkit.entity.Firework;
  19. import org.bukkit.entity.Player;
  20. import org.bukkit.event.EventHandler;
  21. import org.bukkit.event.EventPriority;
  22. import org.bukkit.event.Listener;
  23. import org.bukkit.event.block.Action;
  24. import org.bukkit.event.block.BlockBreakEvent;
  25. import org.bukkit.event.block.BlockPlaceEvent;
  26. import org.bukkit.event.block.LeavesDecayEvent;
  27. import org.bukkit.event.entity.CreatureSpawnEvent;
  28. import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
  29. import org.bukkit.event.entity.EntityDamageByBlockEvent;
  30. import org.bukkit.event.entity.EntityDamageByEntityEvent;
  31. import org.bukkit.event.entity.EntityDamageEvent;
  32. import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
  33. import org.bukkit.event.entity.FoodLevelChangeEvent;
  34. import org.bukkit.event.inventory.InventoryClickEvent;
  35. import org.bukkit.event.player.AsyncPlayerChatEvent;
  36. import org.bukkit.event.player.PlayerCommandPreprocessEvent;
  37. import org.bukkit.event.player.PlayerDropItemEvent;
  38. import org.bukkit.event.player.PlayerInteractEvent;
  39. import org.bukkit.event.player.PlayerJoinEvent;
  40. import org.bukkit.event.player.PlayerLoginEvent;
  41. import org.bukkit.event.player.PlayerMoveEvent;
  42. import org.bukkit.event.player.PlayerQuitEvent;
  43. import org.bukkit.event.player.PlayerTeleportEvent;
  44. import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
  45. import org.bukkit.event.weather.WeatherChangeEvent;
  46. import org.bukkit.help.HelpTopic;
  47. import org.bukkit.inventory.ItemStack;
  48. import org.bukkit.inventory.meta.FireworkMeta;
  49. import org.bukkit.inventory.meta.ItemMeta;
  50. import org.bukkit.plugin.java.JavaPlugin;
  51.  
  52. import com.connorlinfoot.titleapi.TitleAPI;
  53.  
  54. public class Main extends JavaPlugin implements Listener {
  55.     public static Main main;
  56.     public static final HashMap<String, Long> COOLDOWN = new HashMap<>();
  57.     public static final HashMap<String, Long> COOLDOWN3 = new HashMap<>();
  58.     public static final int DELAY_IN_SECONDS = 3;
  59.     public static final int DELAY_IN_SECONDS2 = 10;
  60.     public static final int DELAY_IN_SECONDS3 = 2;
  61.     public static final HashMap<String, Long> COOLDOWN2 = new HashMap<>();
  62.     public static final int DELAY_IN_SECONDS4 = 2;
  63.  
  64.     public void onEnable() {
  65.         getLogger().info("Plugin WandNetwork Iniciando");
  66.         getLogger().info("Plugin Inteiramente feito por: VeryStyle");
  67.         getLogger()
  68.                 .info("Caso não tenha permissão sobre este plugin Estará sujeiro aos termos");
  69.         getLogger().info("Termos: http://wandnetwork.net/nossoplugin.html");
  70.         getLogger().info("Neste Momento: Desenvolvimento");
  71.         Bukkit.getServer().getPluginManager().registerEvents(this, this);
  72.         Bukkit.getServer().getPluginManager().registerEvents(new Menu(), this);
  73.  
  74.         getConfig().options().copyDefaults(true);
  75.         saveConfig();
  76.  
  77.     }
  78.  
  79.     public void onDisable() {
  80.         getLogger().info("Plugin Foi parado!");
  81.         getLogger().info("Cuidado Com desligamentos Acidentais!");
  82.         Bukkit.savePlayers();
  83.         for (World world : Bukkit.getWorlds()) {
  84.             world.save();
  85.         }
  86.         getLogger().info("Mapa Salvo com sucesso!");
  87.  
  88.     }
  89.  
  90.     @EventHandler
  91.     public void NoBreak(BlockBreakEvent e) {
  92.         Player p = e.getPlayer();
  93.  
  94.         if (!p.hasPermission("wand.adm")) {
  95.             p.sendMessage("§cVocê não pode quebrar blocos aqui!");
  96.             e.setCancelled(true);
  97.         }
  98.         if (p.isOp()) {
  99.             if (!p.hasPermission("wand.adm")) {
  100.                 p.sendMessage("§cOp no WandNetwork não te permite quebrar blocos.");
  101.             }
  102.         }
  103.     }
  104.  
  105.     @EventHandler
  106.     public void NaoBota(BlockPlaceEvent e) {
  107.         Player p = e.getPlayer();
  108.  
  109.         if (!p.hasPermission("wand.adm")) {
  110.             p.sendMessage("§cVocê não pode por blocos aqui!");
  111.             e.setCancelled(true);
  112.         }
  113.         if (p.isOp()) {
  114.             if (!p.hasPermission("wand.adm")) {
  115.                 p.sendMessage("§cOp no WandNetwork não te permite quebrar blocos.");
  116.             }
  117.         }
  118.     }
  119.  
  120.     @EventHandler
  121.     public void QuandoSpawna(CreatureSpawnEvent e) {
  122.         if (e.getSpawnReason() == SpawnReason.EGG) {
  123.             e.setCancelled(true);
  124.         }
  125.     }
  126.  
  127.     @EventHandler
  128.     private void onWeatherChange(WeatherChangeEvent e) {
  129.         if (e.toWeatherState())
  130.             e.setCancelled(true);
  131.     }
  132.  
  133.     @EventHandler
  134.     public void onPlayerQuit(PlayerQuitEvent e) {
  135.         Player p = e.getPlayer();
  136.         e.setQuitMessage(null);
  137.         getConfig().set("Parkour." + p.getDisplayName(), null);
  138.         saveConfig();
  139.     }
  140.  
  141.     @EventHandler
  142.     public void invClick(InventoryClickEvent e) {
  143.         Player p = (Player) e.getWhoClicked();
  144.         if (!p.hasPermission("wand.adm")) {
  145.             e.setCancelled(true);
  146.             p.updateInventory();
  147.         }
  148.     }
  149.  
  150.     @EventHandler
  151.     public void FolhasCaem(LeavesDecayEvent e) {
  152.         e.setCancelled(true);
  153.     }
  154.  
  155.     @SuppressWarnings({ "deprecation" })
  156.     @EventHandler
  157.     public void JoinCoisas(PlayerJoinEvent e) {
  158.         Player p = e.getPlayer();
  159.         Location local = p.getLocation();
  160.  
  161.         p.playSound(local, Sound.SUCCESSFUL_HIT, 10.0F, 10.0F);
  162.         p.teleport(p.getWorld().getSpawnLocation());
  163.         p.sendMessage("§9Lobby > §7Bem vindo a §aWandNetwork!");
  164.         p.setGameMode(GameMode.ADVENTURE);
  165.         p.getInventory().setArmorContents(null);
  166.         p.setExp(0f);
  167.         p.playEffect(local, Effect.HAPPY_VILLAGER, 1);
  168.         e.setJoinMessage(null);
  169.         getConfig().set("Parkour." + p.getDisplayName(), null);
  170.         saveConfig();
  171.  
  172.         if (p.hasPermission("wand.player")) {
  173.             if (!p.hasPermission("wand.adm")) {
  174.                 if (!p.hasPermission("wand.mod")) {
  175.                     if (!p.hasPermission("wand.helper")) {
  176.                         if (!p.hasPermission("wand.vip2")) {
  177.                             if (!p.hasPermission("wand.vip1")) {
  178.                                 if (!p.hasPermission("wand.youtuber")) {
  179.                                     p.setAllowFlight(false);
  180.                                     p.setFlying(false);
  181.                                     p.setDisplayName("§7" + p.getName());
  182.                                 }
  183.                             }
  184.                         }
  185.                     }
  186.                 }
  187.             }
  188.         }
  189.  
  190.         if (p.hasPermission("wand.vip1")) {
  191.             if (!p.hasPermission("wand.adm")) {
  192.                 if (!p.hasPermission("wand.mod")) {
  193.                     if (!p.hasPermission("wand.helper")) {
  194.                         if (!p.hasPermission("wand.vip2")) {
  195.                             if (!p.hasPermission("wand.youtuber")) {
  196.                                 p.setAllowFlight(true);
  197.                                 p.setFlying(true);
  198.                                 p.setDisplayName("§7[§6VIP§7] §f" + p.getName());
  199.                             }
  200.                         }
  201.                     }
  202.                 }
  203.             }
  204.         }
  205.  
  206.         if (p.hasPermission("wand.vip2")) {
  207.             if (!p.hasPermission("wand.adm")) {
  208.                 if (!p.hasPermission("wand.mod")) {
  209.                     if (!p.hasPermission("wand.helper")) {
  210.                         if (!p.hasPermission("wand.youtuber")) {
  211.                             p.setAllowFlight(true);
  212.                             p.setFlying(true);
  213.                             p.setDisplayName("§7[§6VIP§c+§7] §f" + p.getName());
  214.                         }
  215.                     }
  216.                 }
  217.  
  218.             }
  219.         }
  220.         if (p.hasPermission("wand.helper")) {
  221.             if (!p.hasPermission("wand.adm")) {
  222.                 p.setAllowFlight(true);
  223.                 p.setFlying(true);
  224.                 p.setDisplayName("§7[§5Helper§7] §f" + p.getName());
  225.  
  226.             }
  227.         }
  228.         if (p.hasPermission("wand.mod")) {
  229.             if (!p.hasPermission("wand.adm")) {
  230.                 p.setAllowFlight(true);
  231.                 p.setFlying(true);
  232.                 p.setDisplayName("§7[§bMOD§7] §f" + p.getName());
  233.                 Bukkit.broadcastMessage("§9Aviso > §7Um MOD entrou neste lobby!");
  234.             }
  235.         }
  236.         if (p.hasPermission("wand.youtuber")) {
  237.             if (!p.hasPermission("wand.adm")) {
  238.                 p.setDisplayName("§7[§0Y§fT§7] §f" + p.getName());
  239.                 Bukkit.broadcastMessage("§9Aviso > §7Um youtuber entrou neste lobby!");
  240.                 p.setAllowFlight(true);
  241.                 p.setFlying(true);
  242.             }
  243.         }
  244.  
  245.     }
  246.  
  247.     @EventHandler
  248.     public void Dano(EntityDamageByEntityEvent e) {
  249.         e.setCancelled(true);
  250.     }
  251.  
  252.     @EventHandler
  253.     public void Dano2(EntityDamageEvent e) {
  254.         if (e.getCause().equals(DamageCause.LAVA)) {
  255.             World w = Bukkit.getWorld("world");
  256.             Player p = (Player) e.getEntity();
  257.             p.teleport(new Location(w, 276.5, 39, 569.5, 135, -3));
  258.             p.sendMessage("§9Parkour > §7Ops! Você caiu na lava. Tente novamente.");
  259.         }
  260.         e.setCancelled(true);
  261.     }
  262.  
  263.     @EventHandler
  264.     public void Dano3(EntityDamageByBlockEvent e) {
  265.         e.setCancelled(true);
  266.     }
  267.  
  268.     @SuppressWarnings({ "deprecation" })
  269.     @EventHandler
  270.     public void JoinItens(PlayerJoinEvent e) {
  271.         Player p = e.getPlayer();
  272.  
  273.         p.getInventory().clear();
  274.  
  275.         if (p.hasPermission("wand.mod")) {
  276.             ItemStack adm = new ItemStack(Material.ANVIL);
  277.             ItemMeta admmeta = adm.getItemMeta();
  278.             admmeta.setDisplayName("§9Staff §7(Botão Direito)");
  279.             adm.setItemMeta(admmeta);
  280.             p.getInventory().setItem(1, adm);
  281.         }
  282.  
  283.         ItemStack lobby = new ItemStack(Material.REDSTONE);
  284.         ItemMeta lobbymeta = lobby.getItemMeta();
  285.         lobbymeta.setDisplayName("§9Lobbys §7(Botão Direito)");
  286.         lobby.setItemMeta(lobbymeta);
  287.         p.getInventory().setItem(3, lobby);
  288.  
  289.         ItemStack bussola = new ItemStack(Material.COMPASS);
  290.         ItemMeta bussolameta = bussola.getItemMeta();
  291.         bussolameta.setDisplayName("§9Games §7(Botão Direito)");
  292.         bussola.setItemMeta(bussolameta);
  293.         p.getInventory().setItem(0, bussola);
  294.  
  295.         ItemStack slime = new ItemStack(Material.SLIME_BALL);
  296.         ItemMeta slimemeta = slime.getItemMeta();
  297.         slimemeta.setDisplayName("§9Visibilidade §a(ON)  §7(Botão Direito)");
  298.         slime.setItemMeta(slimemeta);
  299.         p.getInventory().setItem(8, slime);
  300.  
  301.         ItemStack bau = new ItemStack(Material.CHEST);
  302.         ItemMeta baumeta = bau.getItemMeta();
  303.         baumeta.setDisplayName("§9Gadgets §7(Botão Direito)");
  304.         bau.setItemMeta(baumeta);
  305.         p.getInventory().setItem(5, bau);
  306.  
  307.         ItemStack lava = new ItemStack(Material.LADDER);
  308.         ItemMeta lavameta = lava.getItemMeta();
  309.         lavameta.setDisplayName("§9Parkour §c(OFF)  §7(Botão Direito)");
  310.         lava.setItemMeta(lavameta);
  311.         p.getInventory().setItem(7, lava);
  312.         p.updateInventory();
  313.  
  314.         TitleAPI.sendFullTitle(p, 10, 60, 10, "§bWandNetwork",
  315.                 "§9" + p.getName() + " §7Seja bem vindo!");
  316.         TitleAPI.sendTabTitle(p, "§7§l|§9§lWandNetwork§7§l|",
  317.                 "§3Site: §7wandnetwork.net");
  318.     }
  319.  
  320.     @EventHandler
  321.     public void SemFome(FoodLevelChangeEvent e) {
  322.         e.setCancelled(true);
  323.     }
  324.  
  325.     @EventHandler
  326.     public void ChuvaOff(WeatherChangeEvent e) {
  327.         e.setCancelled(true);
  328.     }
  329.  
  330.     @EventHandler
  331.     public void Parkour(PlayerMoveEvent e) {
  332.         Player p = e.getPlayer();
  333.         Location local = p.getLocation();
  334.         World w = p.getWorld();
  335.  
  336.         if ((local.getY() < 33.0D && getConfig().getBoolean(
  337.                 "Parkour." + p.getDisplayName()))) {
  338.             p.teleport(new Location(w, 276.5, 39, 569.5, 135, -3));
  339.             p.sendMessage("§9Parkour > §7Você caiu =( . Clique na escada para sair do parkour!");
  340.         }
  341.  
  342.         if ((local.getX() >= 249.0D && local.getX() <= 250.0D
  343.                 && local.getY() >= 46.0D && local.getY() <= 47.0D
  344.                 && local.getZ() >= 552.0D && local.getZ() <= 553.0D)) {
  345.             if (getConfig().getString("Ganhadores." + p.getDisplayName()) != null) {
  346.                 if (COOLDOWN3.containsKey(p.getName().toLowerCase())) {
  347.                     if ((System.currentTimeMillis() / 1000) >= (COOLDOWN3.get(p
  348.                             .getName().toLowerCase()) + DELAY_IN_SECONDS3)) {
  349.                         COOLDOWN3.remove(p.getName().toLowerCase());
  350.                     } else {
  351.                         return;
  352.                     }
  353.                     p.sendMessage("§9Parkour > §7Ops! Você não pode fazer o parkour duas vezes!");
  354.                     COOLDOWN3.put(p.getName().toLowerCase(),
  355.                             (System.currentTimeMillis() / 1000));
  356.                     return;
  357.                 }
  358.                 if (getConfig().getString("Parkour." + p.getDisplayName()) == null) {
  359.                     if (COOLDOWN3.containsKey(p.getName().toLowerCase())) {
  360.                         if ((System.currentTimeMillis() / 1000) >= (COOLDOWN3
  361.                                 .get(p.getName().toLowerCase()) + DELAY_IN_SECONDS3)) {
  362.                             COOLDOWN3.remove(p.getName().toLowerCase());
  363.                         } else {
  364.                             return;
  365.                         }
  366.                     }
  367.                     p.sendMessage("§9Parkour > §7Ops! Você precisa iniciar o parkour antes de terminar!");
  368.                     COOLDOWN3.put(p.getName().toLowerCase(),
  369.                             (System.currentTimeMillis() / 1000));
  370.                     return;
  371.                 }
  372.             }
  373.             p.sendMessage("§9Parkour > §7Parabens, você ganhou o parkour!");
  374.             p.sendMessage("§9WCs > §7Foram creditados 500 moedas na sua conta!");
  375.             getConfig().set("Parkour." + p.getDisplayName(), null);
  376.             saveConfig();
  377.  
  378.             if (p.hasPermission("wand.vip1")) {
  379.                 p.setAllowFlight(true);
  380.                 p.setFlying(true);
  381.             }
  382.             if (p.hasPermission("wand.vip2")) {
  383.                 p.setAllowFlight(true);
  384.                 p.setFlying(true);
  385.  
  386.             }
  387.             if (p.hasPermission("wand.mod")) {
  388.                 p.setAllowFlight(true);
  389.                 p.setFlying(true);
  390.  
  391.             }
  392.             if (p.hasPermission("wand.youtuber")) {
  393.                 p.setAllowFlight(true);
  394.                 p.setFlying(true);
  395.  
  396.             }
  397.             if (p.hasPermission("wand.helper")) {
  398.                 p.setAllowFlight(true);
  399.                 p.setFlying(true);
  400.  
  401.             }
  402.  
  403.             ItemStack lava = new ItemStack(Material.LADDER);
  404.             ItemMeta lavameta = lava.getItemMeta();
  405.             lavameta.setDisplayName("§9Parkour §c(OFF)  §7(Botão Direito)");
  406.             lava.setItemMeta(lavameta);
  407.             p.getInventory().setItem(7, lava);
  408.             p.updateInventory();
  409.             p.teleport(new Location(w, 276.5, 39, 569.5, 135, -3));
  410.             getConfig().set("Ganhadores." + p.getDisplayName(), "Ja Ganhou");
  411.             saveConfig();
  412.             Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(),
  413.                     "money give " + p.getName() + " 500");
  414.         }
  415.  
  416.         if ((local.getX() >= 277.0D && local.getX() <= 278.0D
  417.                 && local.getY() >= 38.0D && local.getY() <= 39.0D
  418.                 && local.getZ() >= 571.0D && local.getZ() <= 572.0D)) {
  419.  
  420.             if (getConfig().getBoolean("Parkour." + p.getDisplayName())) {
  421.                 if (COOLDOWN3.containsKey(p.getName().toLowerCase())) {
  422.                     if ((System.currentTimeMillis() / 1000) >= (COOLDOWN3.get(p
  423.                             .getName().toLowerCase()) + DELAY_IN_SECONDS3)) {
  424.                         COOLDOWN3.remove(p.getName().toLowerCase());
  425.                     } else {
  426.                         return;
  427.                     }
  428.                 }
  429.  
  430.                 p.sendMessage("§9Parkour > §7Este modo está ativado!");
  431.                 COOLDOWN3.put(p.getName().toLowerCase(),
  432.                         (System.currentTimeMillis() / 1000));
  433.                 return;
  434.  
  435.             }
  436.             p.sendMessage("§9Parkour > §7Parkour Iniciado!");
  437.  
  438.             ItemStack lava = new ItemStack(Material.LADDER);
  439.             ItemMeta lavameta = lava.getItemMeta();
  440.             lavameta.setDisplayName("§9Parkour §a(ON)  §7(Botão Direito)");
  441.             lava.setItemMeta(lavameta);
  442.             p.getInventory().setItem(7, lava);
  443.             p.updateInventory();
  444.             COOLDOWN3.put(p.getName().toLowerCase(),
  445.                     (System.currentTimeMillis() / 1000));
  446.             getConfig().set("Parkour." + p.getDisplayName(), true);
  447.             saveConfig();
  448.             if (p.getAllowFlight()) {
  449.                 p.setAllowFlight(false);
  450.                 p.setFlying(false);
  451.                 p.sendMessage("§9Parkour > §7Fly desabilitado!");
  452.             }
  453.         }
  454.         if (p.hasPermission("wand.vip1")) {
  455.             if (!p.hasPermission("wand.vip2")) {
  456.                 if (!p.hasPermission("wand.youtuber")) {
  457.                     if (!p.hasPermission("wand.helper")) {
  458.                         if (!p.hasPermission("wand.mod")) {
  459.  
  460.                             p.setAllowFlight(true);
  461.                             p.setDisplayName("§7[§6VIP§7] §f" + p.getName());
  462.                             p.setFlying(true);
  463.                         }
  464.                     }
  465.                 }
  466.             }
  467.         }
  468.  
  469.         if (p.hasPermission("wand.vip2")) {
  470.             if (!p.hasPermission("wand.youtuber")) {
  471.                 if (!p.hasPermission("wand.helper")) {
  472.                     if (!p.hasPermission("wand.mod")) {
  473.  
  474.                         p.setAllowFlight(true);
  475.                         p.setDisplayName("§7[§6VIP§c+§7] §f" + p.getName());
  476.                         p.setFlying(true);
  477.                     }
  478.                 }
  479.             }
  480.         }
  481.     }
  482.  
  483.     @EventHandler
  484.     public void OnMove(PlayerMoveEvent e) {
  485.         Player p = e.getPlayer();
  486.  
  487.         p.setFoodLevel(20);
  488.         p.setHealth(20D);
  489.         Location local = p.getLocation();
  490.  
  491.         if ((local.getY() < 0.0D)) {
  492.             p.getInventory().clear();
  493.             p.teleport(p.getWorld().getSpawnLocation());
  494.             ItemStack lobby = new ItemStack(Material.REDSTONE);
  495.             ItemMeta lobbymeta = lobby.getItemMeta();
  496.             lobbymeta.setDisplayName("§9Lobbys §7(Botão Direito)");
  497.             lobby.setItemMeta(lobbymeta);
  498.             p.getInventory().setItem(3, lobby);
  499.  
  500.             ItemStack bussola = new ItemStack(Material.COMPASS);
  501.             ItemMeta bussolameta = bussola.getItemMeta();
  502.             bussolameta.setDisplayName("§9Games §7(Botão Direito)");
  503.             bussola.setItemMeta(bussolameta);
  504.             p.getInventory().setItem(0, bussola);
  505.  
  506.             ItemStack slime = new ItemStack(Material.SLIME_BALL);
  507.             ItemMeta slimemeta = slime.getItemMeta();
  508.             slimemeta
  509.                     .setDisplayName("§9Visibilidade §a(ON)  §7(Botão Direito)");
  510.             slime.setItemMeta(slimemeta);
  511.             p.getInventory().setItem(8, slime);
  512.  
  513.             ItemStack bau = new ItemStack(Material.CHEST);
  514.             ItemMeta baumeta = bau.getItemMeta();
  515.             baumeta.setDisplayName("§9Gadgets §7(Botão Direito)");
  516.             bau.setItemMeta(baumeta);
  517.             p.getInventory().setItem(5, bau);
  518.  
  519.             ItemStack lava = new ItemStack(Material.LADDER);
  520.             ItemMeta lavameta = lava.getItemMeta();
  521.             lavameta.setDisplayName("§9Parkour §c(OFF)  §7(Botão Direito)");
  522.             lava.setItemMeta(lavameta);
  523.             p.getInventory().setItem(7, lava);
  524.  
  525.             if (p.hasPermission("wand.mod")) {
  526.                 ItemStack adm = new ItemStack(Material.ANVIL);
  527.                 ItemMeta admmeta = adm.getItemMeta();
  528.                 admmeta.setDisplayName("§9Staff §7(Botão Direito)");
  529.                 adm.setItemMeta(admmeta);
  530.                 p.getInventory().setItem(1, adm);
  531.             }
  532.  
  533.             p.updateInventory();
  534.         }
  535.         World w = Bukkit.getWorld("world");
  536.         if ((local.getX() > 240.0D && local.getX() < 241.0D
  537.                 && local.getY() > 28.0 && local.getY() < 33.0
  538.                 && local.getZ() < 582.0 && local.getZ() > 575.0)) {
  539.             p.teleport(new Location(w, 99.5D, 100.0D, 101.5D, 45.0F, 0F));
  540.         }
  541.     }
  542.  
  543.     @EventHandler
  544.     public void onTeleport(PlayerTeleportEvent e) {
  545.         if (e.getCause().equals(TeleportCause.ENDER_PEARL)) {
  546.             e.setCancelled(true);
  547.         }
  548.     }
  549.  
  550.     @SuppressWarnings({ "deprecation" })
  551.     @EventHandler
  552.     public void OnClickEvent(final PlayerInteractEvent e) {
  553.         final Player p = e.getPlayer();
  554.  
  555.         if (((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK))
  556.                 && (p.getItemInHand().getType().equals(Material.REDSTONE))) {
  557.             if (COOLDOWN.containsKey(p.getName().toLowerCase())) {
  558.                 if ((System.currentTimeMillis() / 1000) >= (COOLDOWN.get(p
  559.                         .getName().toLowerCase()) + DELAY_IN_SECONDS)) {
  560.                     COOLDOWN.remove(p.getName().toLowerCase());
  561.                 } else {
  562.                     p.sendMessage("§cAguarde "
  563.                             + ((COOLDOWN.get(p.getName().toLowerCase()) + DELAY_IN_SECONDS) - (System
  564.                                     .currentTimeMillis() / 1000))
  565.                             + " segundos para usar novamente.");
  566.                     return;
  567.                 }
  568.             }
  569.             COOLDOWN.put(p.getName().toLowerCase(),
  570.                     (System.currentTimeMillis() / 1000));
  571.             p.openInventory(Menu.lobby);
  572.  
  573.         }
  574.  
  575.         if (((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK))
  576.                 && (p.getItemInHand().getType().equals(Material.SLIME_BALL))) {
  577.             if (COOLDOWN.containsKey(p.getName().toLowerCase())) {
  578.                 if ((System.currentTimeMillis() / 1000) >= (COOLDOWN.get(p
  579.                         .getName().toLowerCase()) + DELAY_IN_SECONDS2)) {
  580.                     COOLDOWN.remove(p.getName().toLowerCase());
  581.                 } else {
  582.                     p.sendMessage("§cAguarde "
  583.                             + ((COOLDOWN.get(p.getName().toLowerCase()) + DELAY_IN_SECONDS2) - (System
  584.                                     .currentTimeMillis() / 1000))
  585.                             + " segundos para usar novamente.");
  586.                     return;
  587.                 }
  588.             }
  589.             for (Player resto : Bukkit.getServer().getOnlinePlayers()) {
  590.                 p.hidePlayer(resto);
  591.             }
  592.  
  593.             Location local = p.getLocation();
  594.             p.playSound(local, Sound.VILLAGER_DEATH, 10.0F, 3.0F);
  595.             p.playEffect(local, Effect.SMOKE, 4);
  596.             p.getInventory().removeItem(
  597.                     new ItemStack[] { new ItemStack(Material.getMaterial(341),
  598.                             1) });
  599.             ItemStack magma = new ItemStack(Material.MAGMA_CREAM);
  600.             ItemMeta magmameta = magma.getItemMeta();
  601.             magmameta
  602.                     .setDisplayName("§9Visibilidade §c(OFF)  §7(Botão Direito)");
  603.             magma.setItemMeta(magmameta);
  604.             p.getInventory().setItem(8, magma);
  605.             p.updateInventory();
  606.  
  607.             COOLDOWN.put(p.getName().toLowerCase(),
  608.                     (System.currentTimeMillis() / 1000));
  609.             p.sendMessage("§4Jogadores escondidos!");
  610.             TitleAPI.sendFullTitle(p, 10, 60, 10, "", "§9"
  611.                     + "§7§f§l➤  §4Jogadores escondidos");
  612.  
  613.         }
  614.  
  615.         if (((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK))
  616.                 && (p.getItemInHand().getType().equals(Material.MAGMA_CREAM))) {
  617.             if (COOLDOWN.containsKey(p.getName().toLowerCase())) {
  618.                 if ((System.currentTimeMillis() / 1000) >= (COOLDOWN.get(p
  619.                         .getName().toLowerCase()) + DELAY_IN_SECONDS2)) {
  620.                     COOLDOWN.remove(p.getName().toLowerCase());
  621.                 } else {
  622.                     p.sendMessage("§cAguarde "
  623.                             + ((COOLDOWN.get(p.getName().toLowerCase()) + DELAY_IN_SECONDS2) - (System
  624.                                     .currentTimeMillis() / 1000))
  625.                             + " segundos para usar novamente.");
  626.                     return;
  627.                 }
  628.             }
  629.             for (Player resto2 : Bukkit.getServer().getOnlinePlayers()) {
  630.                 p.showPlayer(resto2);
  631.             }
  632.  
  633.             Location local = p.getLocation();
  634.             p.playSound(local, Sound.CAT_MEOW, 10.0F, 3.0F);
  635.             p.playEffect(local, Effect.SMOKE, 4);
  636.             p.getInventory().removeItem(
  637.                     new ItemStack[] { new ItemStack(Material.getMaterial(378),
  638.                             1) });
  639.             p.updateInventory();
  640.             ItemStack slime = new ItemStack(Material.SLIME_BALL);
  641.             ItemMeta slimemeta = slime.getItemMeta();
  642.             slimemeta
  643.                     .setDisplayName("§9Visibilidade §a(ON)  §7(Botão Direito)");
  644.             slime.setItemMeta(slimemeta);
  645.             p.getInventory().setItem(8, slime);
  646.  
  647.             COOLDOWN.put(p.getName().toLowerCase(),
  648.                     (System.currentTimeMillis() / 1000));
  649.             p.sendMessage("§aJogadores revelados!");
  650.             TitleAPI.sendFullTitle(p, 10, 60, 10, "", "§9"
  651.                     + "§f§l➤  §aJogadores revelados");
  652.  
  653.         }
  654.         if (((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK))
  655.                 && (p.getItemInHand().getType().equals(Material.CHEST))) {
  656.             if (COOLDOWN.containsKey(p.getName().toLowerCase())) {
  657.                 if ((System.currentTimeMillis() / 1000) >= (COOLDOWN.get(p
  658.                         .getName().toLowerCase()) + DELAY_IN_SECONDS)) {
  659.                     COOLDOWN.remove(p.getName().toLowerCase());
  660.                 } else {
  661.                     p.sendMessage("§cAguarde "
  662.                             + ((COOLDOWN.get(p.getName().toLowerCase()) + DELAY_IN_SECONDS) - (System
  663.                                     .currentTimeMillis() / 1000))
  664.                             + " segundos para usar novamente.");
  665.                     return;
  666.                 }
  667.             }
  668.             if (getConfig().getBoolean("Parkour." + p.getDisplayName())) {
  669.                 p.sendMessage("§9Gadgets > §7Estão desativados no parkour.");
  670.                 COOLDOWN.put(p.getName().toLowerCase(),
  671.                         (System.currentTimeMillis() / 1000));
  672.                 return;
  673.             }
  674.             p.chat("/hubgadgets gui");
  675.             COOLDOWN.put(p.getName().toLowerCase(),
  676.                     (System.currentTimeMillis() / 1000));
  677.         }
  678.  
  679.         if (((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK))
  680.                 && (p.getItemInHand().getType().equals(Material.COMPASS))) {
  681.             if (COOLDOWN.containsKey(p.getName().toLowerCase())) {
  682.                 if ((System.currentTimeMillis() / 1000) >= (COOLDOWN.get(p
  683.                         .getName().toLowerCase()) + DELAY_IN_SECONDS3)) {
  684.                     COOLDOWN.remove(p.getName().toLowerCase());
  685.                 } else {
  686.                     p.sendMessage("§cAguarde "
  687.                             + ((COOLDOWN.get(p.getName().toLowerCase()) + DELAY_IN_SECONDS3) - (System
  688.                                     .currentTimeMillis() / 1000))
  689.                             + " segundos para usar a bússola novamente.");
  690.                     return;
  691.                 }
  692.             }
  693.             COOLDOWN.put(p.getName().toLowerCase(),
  694.                     (System.currentTimeMillis() / 1000));
  695.             p.openInventory(Menu.menu);
  696.         }
  697.  
  698.         if (((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK))
  699.                 && (p.getItemInHand().getType().equals(Material.LADDER))) {
  700.             if (COOLDOWN.containsKey(p.getName().toLowerCase())) {
  701.                 if ((System.currentTimeMillis() / 1000) >= (COOLDOWN.get(p
  702.                         .getName().toLowerCase()) + DELAY_IN_SECONDS)) {
  703.                     COOLDOWN.remove(p.getName().toLowerCase());
  704.                 } else {
  705.                     p.sendMessage("§cAguarde "
  706.                             + ((COOLDOWN.get(p.getName().toLowerCase()) + DELAY_IN_SECONDS) - (System
  707.                                     .currentTimeMillis() / 1000))
  708.                             + " segundos para usar novamente.");
  709.                     return;
  710.                 }
  711.             }
  712.             if (e.getItem().getItemMeta().getDisplayName()
  713.                     .contains("§9Parkour §a(ON)  §7(Botão Direito)")) {
  714.                 COOLDOWN.put(p.getName().toLowerCase(),
  715.                         (System.currentTimeMillis() / 1000));
  716.  
  717.                 getConfig().set("Parkour." + p.getDisplayName(), null);
  718.                 saveConfig();
  719.                 p.sendMessage("§9Parkour > §7Modo Desativado!");
  720.  
  721.                 if (p.hasPermission("wand.vip1")) {
  722.                     p.setAllowFlight(true);
  723.                     p.setFlying(true);
  724.                 }
  725.                 if (p.hasPermission("wand.vip2")) {
  726.                     p.setAllowFlight(true);
  727.                     p.setFlying(true);
  728.  
  729.                 }
  730.                 if (p.hasPermission("wand.mod")) {
  731.                     p.setAllowFlight(true);
  732.                     p.setFlying(true);
  733.  
  734.                 }
  735.                 if (p.hasPermission("wand.youtuber")) {
  736.                     p.setAllowFlight(true);
  737.                     p.setFlying(true);
  738.  
  739.                 }
  740.                 if (p.hasPermission("wand.helper")) {
  741.                     p.setAllowFlight(true);
  742.                     p.setFlying(true);
  743.  
  744.                 }
  745.  
  746.                 ItemStack lava = new ItemStack(Material.LADDER);
  747.                 ItemMeta lavameta = lava.getItemMeta();
  748.                 lavameta.setDisplayName("§9Parkour §c(OFF)  §7(Botão Direito)");
  749.                 lava.setItemMeta(lavameta);
  750.                 p.getInventory().setItem(7, lava);
  751.                 p.updateInventory();
  752.  
  753.             }
  754.             World w = p.getWorld();
  755.             if (e.getItem().getItemMeta().getDisplayName()
  756.                     .contains("§9Parkour §c(OFF)  §7(Botão Direito)")) {
  757.                 COOLDOWN.put(p.getName().toLowerCase(),
  758.                         (System.currentTimeMillis() / 1000));
  759.                 p.sendMessage("§9Parkour > §7Modo Ativado!");
  760.                 getConfig().set("Parkour." + p.getDisplayName(), true);
  761.                 saveConfig();
  762.                 ItemStack lava = new ItemStack(Material.LADDER);
  763.                 ItemMeta lavameta = lava.getItemMeta();
  764.                 lavameta.setDisplayName("§9Parkour §a(ON)  §7(Botão Direito)");
  765.                 lava.setItemMeta(lavameta);
  766.                 p.getInventory().setItem(7, lava);
  767.                 p.updateInventory();
  768.                 p.teleport(new Location(w, 276.5, 39, 569.5, 135, -3));
  769.  
  770.                 if (p.getAllowFlight()) {
  771.                     p.setAllowFlight(false);
  772.                     p.setFlying(false);
  773.                 }
  774.             }
  775.  
  776.         }
  777.  
  778.         if (((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK))
  779.                 && (p.getItemInHand().getType().equals(Material.ANVIL))) {
  780.             p.openInventory(Menu.staff);
  781.  
  782.         }
  783.     }
  784.  
  785.     @EventHandler
  786.     public void DropItem(PlayerDropItemEvent e) {
  787.         Player p = e.getPlayer();
  788.         p.sendMessage("§cVocê não pode dropar itens.");
  789.         e.setCancelled(true);
  790.     }
  791.  
  792.     @EventHandler
  793.     public void onPlayerLogin(final PlayerLoginEvent e) {
  794.         Bukkit.getServer().getScheduler()
  795.                 .scheduleSyncDelayedTask(this, new Runnable() {
  796.                     public void run() {
  797.                         if (e.getPlayer().hasPlayedBefore())
  798.                             return;
  799.                         getConfig().set("Jogadores",
  800.                                 getConfig().getInt("Jogadores") + 1);
  801.                         saveConfig();
  802.  
  803.                         Firework f = (Firework) e
  804.                                 .getPlayer()
  805.                                 .getWorld()
  806.                                 .spawn(e.getPlayer().getLocation(),
  807.                                         Firework.class);
  808.  
  809.                         FireworkMeta fm = f.getFireworkMeta();
  810.                         fm.addEffect(FireworkEffect.builder().flicker(false)
  811.                                 .trail(true).with(Type.CREEPER)
  812.                                 .withColor(Color.GREEN).withFade(Color.BLUE)
  813.                                 .build());
  814.                         fm.setPower(3);
  815.                         f.setFireworkMeta(fm);
  816.                     }
  817.                 }, 20);
  818.     }
  819.  
  820.     @EventHandler
  821.     public void FormatChat(AsyncPlayerChatEvent e) {
  822.         Player p = e.getPlayer();
  823.         e.setCancelled(true);
  824.         String msg = e.getMessage();
  825.         if (getConfig().getBoolean("ChatAtivado")) {
  826.  
  827.             if (COOLDOWN3.containsKey(p.getName().toLowerCase())) {
  828.                 if ((System.currentTimeMillis() / 1000) >= (COOLDOWN3.get(p
  829.                         .getName().toLowerCase()) + DELAY_IN_SECONDS4)) {
  830.                     COOLDOWN3.remove(p.getName().toLowerCase());
  831.                 } else {
  832.                     p.sendMessage("§cAguarde "
  833.                             + ((COOLDOWN3.get(p.getName().toLowerCase()) + DELAY_IN_SECONDS4) - (System
  834.                                     .currentTimeMillis() / 1000))
  835.                             + " segundos para usar novamente.");
  836.                     return;
  837.                 }
  838.             }
  839.             COOLDOWN3.put(p.getName().toLowerCase(),
  840.                     (System.currentTimeMillis() / 1000));
  841.  
  842.             if (p.hasPermission("wand.mod")) {
  843.                 msg = msg.replaceAll("&", "§");
  844.             } else {
  845.                 msg = msg.replaceAll("&", "&");
  846.             }
  847.  
  848.             Bukkit.broadcastMessage(p.getDisplayName() + ChatColor.GRAY + ": "
  849.                     + msg);
  850.         } else {
  851.             if (!p.hasPermission("wand.mod")) {
  852.                 p.sendMessage("§9Chat > §7Chat desativado neste lobby.");
  853.             } else {
  854.                 if (p.hasPermission("wand.mod")) {
  855.                     msg = msg.replaceAll("&", "§");
  856.                 } else {
  857.                     msg = msg.replaceAll("&", "&");
  858.                 }
  859.  
  860.                 Bukkit.broadcastMessage(p.getDisplayName() + ChatColor.GRAY
  861.                         + ": " + msg);
  862.  
  863.             }
  864.         }
  865.     }
  866.  
  867.     @EventHandler(priority = EventPriority.HIGHEST)
  868.     public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
  869.         Player p = event.getPlayer();
  870.         if ((!event.isCancelled())) {
  871.             String command = event.getMessage().split(" ")[0];
  872.             HelpTopic htopic = Bukkit.getServer().getHelpMap()
  873.                     .getHelpTopic(command);
  874.             if (htopic == null) {
  875.                 p.sendMessage("§9Erro > §7Ops! Comando inexistente!");
  876.                 event.setCancelled(true);
  877.             }
  878.         }
  879.  
  880.         String[] args = event.getMessage().substring(1).split(" ");
  881.  
  882.         if ((args[0].equalsIgnoreCase("plugins"))
  883.                 || (args[0].equalsIgnoreCase("pl")))
  884.             if (event.getPlayer().hasPermission("wand.adm")) {
  885.                 event.getPlayer().sendMessage("§9Wand Plugins: §7");
  886.             } else {
  887.                 event.getPlayer().sendMessage(
  888.                         "§9Erro > §7Ops! Comando inexistente!");
  889.                 event.setCancelled(true);
  890.             }
  891.  
  892.     }
  893.  
  894.     public boolean onCommand(CommandSender sender, Command cmd,
  895.             String commandLable, String[] args) {
  896.  
  897.         StringBuilder str = new StringBuilder();
  898.         for (int i = 0; i < args.length; i++) {
  899.             str.append(args[i] + " ");
  900.         }
  901.         Player p = (Player) sender;
  902.  
  903.         if (cmd.getName().equalsIgnoreCase("money")) {
  904.             p.sendMessage("§9Erro > §7Ops! Comando inexistente!");
  905.  
  906.         }
  907.         if (cmd.getName().equalsIgnoreCase("plugins")) {
  908.             p.sendMessage("§9Erro > §7Ops! Comando inexistente!");
  909.  
  910.         }
  911.         if (cmd.getName().equalsIgnoreCase("help")) {
  912.             p.sendMessage("§9Erro > §7Ops! Comando inexistente!");
  913.  
  914.         }
  915.         if (cmd.getName().equalsIgnoreCase("?")) {
  916.             p.sendMessage("§9Erro > §7Ops! Comando inexistente!");
  917.  
  918.         }
  919.         if (cmd.getName().equalsIgnoreCase("about")) {
  920.             p.sendMessage("§9Erro > §7Ops! Comando inexistente!");
  921.  
  922.         }
  923.         if (cmd.getName().equalsIgnoreCase("ver")) {
  924.             p.sendMessage("§9Erro > §7Ops! Comando inexistente!");
  925.  
  926.         }
  927.         if (cmd.getName().equalsIgnoreCase("version")) {
  928.             p.sendMessage("§9Erro > §7Ops! Comando inexistente!");
  929.  
  930.         }
  931.  
  932.         if (cmd.getName().equalsIgnoreCase("fake")) {
  933.             if (!p.hasPermission("wand.mod")) {
  934.                 p.sendMessage("§9Erro > §7Ops! Comando inexistente!");
  935.                 return true;
  936.             }
  937.             if (args.length != 1) {
  938.                 p.sendMessage("§9Staff > §7Comando correto: /fake <nick>");
  939.                 return true;
  940.             }
  941.  
  942.             p.setDisplayName(str.toString());
  943.             p.sendMessage("§9Staff > §7Nome mudado para: " + str.toString());
  944.             for (Player tudo : Bukkit.getOnlinePlayers()) {
  945.                 tudo.hidePlayer(p);
  946.             }
  947.             getConfig().set("Staff.Invisivel." + p.getName(), true);
  948.             saveConfig();
  949.  
  950.         }
  951.  
  952.         if (cmd.getName().equalsIgnoreCase("real")) {
  953.             if (!p.hasPermission("wand.mod")) {
  954.                 p.sendMessage("§9Erro > §7Ops! Comando inexistente!");
  955.                 return true;
  956.             }
  957.             if (args.length != 0) {
  958.                 p.sendMessage("§9Staff > §7Comando correto: /fake <nick>");
  959.                 return true;
  960.             }
  961.             if (p.hasPermission("wand.mod")) {
  962.                 p.sendMessage("§9Staff > §7Nick voltado ao real!");
  963.                 p.setDisplayName("§7[§bMOD§7] §f" + p.getName());
  964.             }
  965.             if (p.hasPermission("wand.adm")) {
  966.                 p.setDisplayName("§7[§cADM§7] §f" + p.getName());
  967.             }
  968.             getConfig().set("Staff.Invisivel." + p.getName(), false);
  969.             saveConfig();
  970.             for (Player tudo : Bukkit.getOnlinePlayers()) {
  971.                 tudo.showPlayer(p);
  972.             }
  973.         }
  974.  
  975.         if (cmd.getName().equalsIgnoreCase("gm")) {
  976.             if (!p.hasPermission("wand.mod")) {
  977.                 p.sendMessage("§9Erro > §7Sem permissão.");
  978.                 return true;
  979.             }
  980.             if (p.getGameMode() == GameMode.CREATIVE) {
  981.                 p.setGameMode(GameMode.SURVIVAL);
  982.                 p.sendMessage("§9Staff > §7Modo mudado para sobrevivencia.");
  983.             } else {
  984.                 if (getConfig().getBoolean("Parkour." + p.getDisplayName())) {
  985.                     p.sendMessage("§9Parkour > §7Modo parkour esta ativado, você não pode mudar para o criativo.");
  986.                     return true;
  987.                 }
  988.                 p.setGameMode(GameMode.CREATIVE);
  989.                 p.sendMessage("§9Staff > §7Modo mudado para criativo.");
  990.             }
  991.  
  992.             if ((cmd.getName().equalsIgnoreCase("plugin"))
  993.                     || (cmd.getName().equalsIgnoreCase("plugins"))
  994.                     || (cmd.getName().equalsIgnoreCase("pl"))
  995.                     || (cmd.getName().equalsIgnoreCase("?"))) {
  996.                 p.sendMessage("§9Erro > §7Ops! Comando inexistente!");
  997.             }
  998.  
  999.         }
  1000.         if (cmd.getName().equalsIgnoreCase("fly")) {
  1001.             if (!p.hasPermission("wand.mod")) {
  1002.                 if (p.hasPermission("wand.vip1")) {
  1003.                     p.sendMessage("§9Atenção > §7Vips não podem mudar o modo de voo.");
  1004.                     return true;
  1005.                 }
  1006.                 p.sendMessage("§9Erro > §7Sem permissão.");
  1007.                 return true;
  1008.             }
  1009.             if (p.getAllowFlight()) {
  1010.                 p.setAllowFlight(false);
  1011.                 p.setFlying(false);
  1012.                 p.sendMessage("§9Staff > §7Fly desativado!");
  1013.             } else {
  1014.                 if (getConfig().getBoolean("Parkour." + p.getDisplayName())) {
  1015.                     p.sendMessage("§9Parkour > §7Modo parkour esta ativado, você não pode ativar o fly.");
  1016.                     return true;
  1017.                 }
  1018.                 p.setAllowFlight(true);
  1019.                 p.setFlying(true);
  1020.                 p.sendMessage("§9Staff > §7Fly ativado!");
  1021.             }
  1022.  
  1023.         }
  1024.         if (cmd.getName().equalsIgnoreCase("aparecer")) {
  1025.             if (!p.hasPermission("wand.mod")) {
  1026.                 p.sendMessage("§9Erro > §7Sem permissão.");
  1027.                 return true;
  1028.             }
  1029.             for (Player tudo : Bukkit.getOnlinePlayers()) {
  1030.                 tudo.showPlayer(p);
  1031.             }
  1032.             p.sendMessage("§9Staff > §7Aparecido para todos os players.");
  1033.         }
  1034.  
  1035.         if (cmd.getName().equalsIgnoreCase("desativarchat")) {
  1036.             if (!p.hasPermission("wand.mod")) {
  1037.                 p.sendMessage("§9Erro > §7Sem permissão.");
  1038.                 return true;
  1039.             }
  1040.             p.sendMessage("§9Staff > §7Chat no lobby desativado.");
  1041.             Bukkit.broadcastMessage("§9Aviso > §7Chat neste lobby desativado! Por: §8"
  1042.                     + p.getName());
  1043.             getConfig().set("ChatAtivado", false);
  1044.             saveConfig();
  1045.         }
  1046.         if (cmd.getName().equalsIgnoreCase("ativarchat")) {
  1047.             if (!p.hasPermission("wand.mod")) {
  1048.                 p.sendMessage("§9Erro > §7Sem permissão.");
  1049.                 return true;
  1050.             }
  1051.             p.sendMessage("§9Staff > §7Chat no lobby ativado.");
  1052.             Bukkit.broadcastMessage("§9Aviso > §7Chat neste lobby ativado! Por: §8"
  1053.                     + p.getName());
  1054.             getConfig().set("ChatAtivado", true);
  1055.             saveConfig();
  1056.         }
  1057.  
  1058.         return false;
  1059.     }
  1060.  
  1061. }
Advertisement
Add Comment
Please, Sign In to add comment