@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); }
@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); }
@EventHandler public void BlockGrowEvent(BlockGrowEvent event) { if (!arena.getRegion().isInside(event.getBlock().getLocation()) || arena.getEditMode()) return; event.setCancelled(true); }
@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); }