@EventHandler public void onEntityDamageEvent(EntityDamageEvent event) { if (Lobby.get().isLobbyEnabled()) { if (event.getCause() == EntityDamageEvent.DamageCause.VOID) { Entity entity = event.getEntity(); if (entity != null) { entity.teleport(Settings.get().getLobbyLocation()); } } event.setCancelled(true); } }
@EventHandler public void onWeatherChangeEvent(WeatherChangeEvent event) { if (Lobby.get().isLobbyEnabled()) { event.setCancelled(true); } }
@EventHandler public void onBlockPlaceEvent(BlockPlaceEvent event) { if (Lobby.get().isLobbyEnabled()) { event.setCancelled(true); } }
@EventHandler public void onPlayerSpawnLocation(PlayerSpawnLocationEvent event) { if (Lobby.get().isLobbyEnabled()) { event.setSpawnLocation(Settings.get().getLobbyLocation()); } }
@EventHandler public void onPlayerQuit(PlayerQuitEvent event) { event.setQuitMessage( ChatColor.DARK_GRAY + "Quit> " + ChatColor.WHITE + event.getPlayer().getName()); Lobby.get().removePlayer(event.getPlayer()); }
@EventHandler public void onPlayerJoin(PlayerJoinEvent event) { event.setJoinMessage( ChatColor.DARK_GRAY + "Join> " + ChatColor.WHITE + event.getPlayer().getName()); Lobby.get().addPlayer(event.getPlayer()); }