コード例 #1
0
ファイル: Vanish.java プロジェクト: CainFoool/Adminify
  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;
  }
コード例 #2
0
ファイル: evtKickstick.java プロジェクト: CainFoool/Adminify
  @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()));
    }
  }
コード例 #3
0
ファイル: evtChat.java プロジェクト: CainFoool/Adminify
 @EventHandler
 public void onPlayerAsyncChat(AsyncPlayerChatEvent e) {
   if (Util.hasPermission(e.getPlayer(), "color")) {
     e.setMessage(ChatColor.translateAlternateColorCodes('&', e.getMessage()));
   }
 }