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