public boolean onCommand(CommandSender s, Command c, String l, String[] args) { // if(l.equalsIgnoreCase("vanish")) { if (!(s instanceof Player)) { Util.print(Messages.noConsole); return true; } Player player = (Player) s; if (!Util.hasPermission(player, "vanish")) { Util.sendMessage(player, Messages.noPermission); return true; } player.getWorld().createExplosion(player.getLocation(), 0.0F, false); if (!Util.isVanished(player)) { Util.setVanished(player, true); Util.sendMessage(player, Messages.nowVanished); for (Player online : Adminify.mainClass.getServer().getOnlinePlayers()) { online.hidePlayer(player); } return true; } Util.setVanished(player, false); for (Player online : Adminify.mainClass.getServer().getOnlinePlayers()) { online.showPlayer(player); } Util.sendMessage(player, Messages.noVanished); // } return true; }
@EventHandler public void onPlayerInteractEntity(PlayerInteractEntityEvent e) { Player clicker = e.getPlayer(); if (!Util.isHoldingKickstick(clicker)) return; if (!Util.hasPermission(clicker, "kickstick")) return; if (e.getRightClicked() == null) return; if (e.getRightClicked() instanceof Player) { Player clicked = (Player) e.getRightClicked(); clicked.kickPlayer(Messages.kickedByStick.replace("{A}", clicker.getName())); Util.sendMessage(clicker, Messages.adminKickStick.replace("{P}", clicked.getName())); } }
@EventHandler public void onPlayerAsyncChat(AsyncPlayerChatEvent e) { if (Util.hasPermission(e.getPlayer(), "color")) { e.setMessage(ChatColor.translateAlternateColorCodes('&', e.getMessage())); } }