Esempio n. 1
0
  @EventHandler
  public void onPlayerStopFlying(PlayerToggleFlightEvent e) {

    Player p = e.getPlayer();

    if (ArenaManager.isPlayerPlaying(p)
        && ArenaManager.getPlayersArena(p).getState() == Arena.ArenaState.INGAME) {
      if (!e.isFlying()) {
        e.setCancelled(true);
        p.setFlying(true);
      }
    }
  }
Esempio n. 2
0
  @EventHandler
  public void onPlayerLeave(PlayerQuitEvent e) {

    Player p = e.getPlayer();

    if (ArenaManager.isPlayerPlaying(p)) {

      e.setQuitMessage("");

      Arena arena = ArenaManager.getPlayersArena(p);
      ArenaManager.leave(arena, p, true);
    }
  }