Пример #1
0
 @EventHandler
 public void BlockDamageEvent(BlockDamageEvent event) {
   if (!arena.getRegion().isInside(event.getBlock().getLocation()) || arena.getEditMode()) return;
   if (arena.getArena().isInside(event.getBlock().getLocation()) && arena.isRunning()) {
     Player player = (Player) event.getPlayer();
     Participant participant = arena.getParticipant(player);
     if (participant != null)
       if (participant.getParticipantType() == ParticipantType.PARTICIPANT) {
         event.getBlock().setType(Material.AIR);
         return;
       }
   }
   event.setCancelled(true);
 }
Пример #2
0
 @EventHandler
 public void BlockIgniteEvent(BlockIgniteEvent event) {
   if (!arena.getRegion().isInside(event.getBlock().getLocation()) || arena.getEditMode()) return;
   if (arena.getArena().isInside(event.getBlock().getLocation()) && arena.isRunning()) return;
   event.setCancelled(true);
 }
Пример #3
0
 @EventHandler
 public void BlockGrowEvent(BlockGrowEvent event) {
   if (!arena.getRegion().isInside(event.getBlock().getLocation()) || arena.getEditMode()) return;
   event.setCancelled(true);
 }
Пример #4
0
 @EventHandler
 public void BlockCanBuildEvent(BlockCanBuildEvent event) {
   if (!arena.getRegion().isInside(event.getBlock().getLocation()) || arena.getEditMode()) return;
   if (arena.getArena().isInside(event.getBlock().getLocation()) && arena.isRunning()) return;
   event.setBuildable(false);
 }