Exemplo n.º 1
0
 @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);
   }
 }
Exemplo n.º 2
0
 @EventHandler
 public void onWeatherChangeEvent(WeatherChangeEvent event) {
   if (Lobby.get().isLobbyEnabled()) {
     event.setCancelled(true);
   }
 }
Exemplo n.º 3
0
 @EventHandler
 public void onBlockPlaceEvent(BlockPlaceEvent event) {
   if (Lobby.get().isLobbyEnabled()) {
     event.setCancelled(true);
   }
 }
Exemplo n.º 4
0
 @EventHandler
 public void onPlayerSpawnLocation(PlayerSpawnLocationEvent event) {
   if (Lobby.get().isLobbyEnabled()) {
     event.setSpawnLocation(Settings.get().getLobbyLocation());
   }
 }
Exemplo n.º 5
0
 @EventHandler
 public void onPlayerQuit(PlayerQuitEvent event) {
   event.setQuitMessage(
       ChatColor.DARK_GRAY + "Quit> " + ChatColor.WHITE + event.getPlayer().getName());
   Lobby.get().removePlayer(event.getPlayer());
 }
Exemplo n.º 6
0
 @EventHandler
 public void onPlayerJoin(PlayerJoinEvent event) {
   event.setJoinMessage(
       ChatColor.DARK_GRAY + "Join> " + ChatColor.WHITE + event.getPlayer().getName());
   Lobby.get().addPlayer(event.getPlayer());
 }