private void handleQuit(PlayerEvent e) { SpleefPlayer player = HeavySpleef.getInstance().getSpleefPlayer(e.getPlayer()); QueuesManager.removeFromQueue(player); if (!player.isActive()) { return; } Game game = player.getGame(); game.leave(player, LoseCause.QUIT); }
// This event shouldn't be fired because player is in god mode // But we don't know if someone types /kill player while he's playing // spleef... @EventHandler public void onPlayerDeath(PlayerDeathEvent e) { SpleefPlayer player = HeavySpleef.getInstance().getSpleefPlayer(e.getEntity()); if (player.isActive()) { Game game = player.getGame(); game.leave(player, LoseCause.UNKNOWN); dead.add(player.getRawName()); } else if (player.isSpectating()) { player.getGame().leaveSpectate(player); } }