@EventHandler void onBlockCatchFire(BlockIgniteEvent event) { if (event.getCause().equals(IgniteCause.FLINT_AND_STEEL)) { if (event.getPlayer() != null) { if (!bitQuest.canBuild(event.getBlock().getLocation(), event.getPlayer())) { event.setCancelled(true); event.getPlayer().sendMessage(ChatColor.DARK_RED + "You don't have permission to do that!"); } } } else if (event.getCause().equals(IgniteCause.SPREAD)) { event.setCancelled(true); } }
@EventHandler(ignoreCancelled = true) public void onBlockIgnite(BlockIgniteEvent event) { Block block = event.getBlock(); Cause cause; // Find the cause if (event.getPlayer() != null) { cause = create(event.getPlayer()); } else if (event.getIgnitingEntity() != null) { cause = create(event.getIgnitingEntity()); } else if (event.getIgnitingBlock() != null) { cause = create(event.getIgnitingBlock()); } else { cause = Cause.unknown(); } Events.fireToCancel(event, new PlaceBlockEvent(event, cause, block.getLocation(), Material.FIRE)); }
@EventHandler(priority = EventPriority.LOWEST) public void onBlockIgnite (BlockIgniteEvent igniteEvent) { //don't track in worlds where claims are not enabled if(!GriefPrevention.instance.claimsEnabledForWorld(igniteEvent.getBlock().getWorld())) return; if(!GriefPrevention.instance.config_fireSpreads && igniteEvent.getCause() != IgniteCause.FLINT_AND_STEEL && igniteEvent.getCause() != IgniteCause.LIGHTNING) { igniteEvent.setCancelled(true); } }
@EventHandler public void fireSpread(final BlockIgniteEvent e) { if (!cm.fireSpreadControllerEnabled) { return; } if (BlockIgniteEvent.IgniteCause.SPREAD == e.getCause()) { long now = System.currentTimeMillis(); if (now > this.lastfireSpread + cm.fireSpreadInterval) { this.lastfireSpread = now; } else { e.setCancelled(true); } } } }
@EventHandler(ignoreCancelled = true) public void onIgnite(BlockIgniteEvent ignite) { if (ignite.getIgnitingBlock() == null && ignite.getIgnitingEntity() == null) { return; if (ignite.getIgnitingBlock() == null) { if (ignite.getIgnitingEntity() instanceof Player) { game = BedwarsRel.getInstance().getGameManager() .getGameOfPlayer((Player) ignite.getIgnitingEntity()); } else { game = BedwarsRel.getInstance().getGameManager() .getGameByLocation(ignite.getIgnitingEntity().getLocation()); .getGameByLocation(ignite.getIgnitingBlock().getLocation()); if (ignite.getCause() == IgniteCause.ENDER_CRYSTAL || ignite.getCause() == IgniteCause.LIGHTNING || ignite.getCause() == IgniteCause.SPREAD) { ignite.setCancelled(true); return; if (ignite.getIgnitingEntity() == null) { ignite.setCancelled(true); return; if (!game.getRegion().isPlacedBlock(ignite.getIgnitingBlock()) && ignite.getIgnitingBlock() != null) { game.getRegion().addPlacedBlock(ignite.getIgnitingBlock(), ignite.getIgnitingBlock().getState());
@EventHandler public void onIgnite(BlockIgniteEvent e) { if (ProtectionSystem.build(e.getPlayer(), e.getBlock().getLocation())) { e.setCancelled(true); } }
if (event.isCancelled()) { return; Block block = event.getBlock(); Player player = event.getPlayer(); event.setCancelled(true); } else { if (FieldFlag.PREVENT_FIRE.applies(field, player)) { event.setCancelled(true); plugin.getCommunicationManager().warnFire(player, block, field); event.setCancelled(true); plugin.getTeleportationManager().teleport(player, field, "teleportAnnounceFire");
@EventHandler public void onBlockIgnite(BlockIgniteEvent event) { BlockIgniteEvent.IgniteCause cause = event.getCause(); if (cause == BlockIgniteEvent.IgniteCause.ENDER_CRYSTAL || cause == BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL) Entity entity = event.getIgnitingEntity(); UndoList entityList = controller.getEntityUndo(entity); if (entityList != null) entityList.add(event.getBlock()); return; Block ignitingBlock = event.getIgnitingBlock(); Block targetBlock = event.getBlock(); if (ignitingBlock != null) if (undoList != null) undoList.add(event.getBlock()); return;
/** * Listens for block burn and ignite events around the TARDIS. If the affected block is part of the TARDIS, then the * event is canceled there by providing protection for the TARDIS blocks * * @param event a block catching fire */ @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onBlockIgnite(BlockIgniteEvent event) { Block b = event.getBlock(); for (BlockFace bf : faces) { Block chkBlock = b.getRelative(bf); String l = chkBlock.getLocation().toString(); if (plugin.getGeneralKeeper().getProtectBlockMap().containsKey(l) && !chkBlock.getType().equals(Material.BEDROCK)) { event.setCancelled(true); break; } } }
@EventHandler(priority = EventPriority.HIGH) public void onBlockIgnite(BlockIgniteEvent event) { if (!ConfigEntry.ALLOW_FIRE_PLACE.getBoolean()) { event.setCancelled(true); } }
/** * Igniting fires * @param e - event */ @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public boolean onBlockIgnite(BlockIgniteEvent e) { // Check if this is a portal lighting - that is allowed any time return !e.getBlock().getType().equals(Material.OBSIDIAN) && checkFire(e, e.getBlock().getLocation(), Flags.FIRE); }
@Override public MCIgniteCause getCause() { return BukkitMCIgniteCause.getConvertor().getAbstractedEnum(event.getCause()); }
@Override public MCEntity getIgnitingEntity() { if(event.getIgnitingEntity() != null) { return new BukkitMCEntity(event.getIgnitingEntity()); } return null; }
@Override public MCBlock getIgnitingBlock() { if(event.getIgnitingBlock() != null) { return new BukkitMCBlock(event.getIgnitingBlock()); } return null; }
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST) public void onBlockIgnite(BlockIgniteEvent event) { if (dWorlds.getInstanceByWorld(event.getBlock().getWorld()) == null) { return; } if (event.getCause() != BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL) { event.setCancelled(true); } }
@EventHandler(ignoreCancelled = true) public void onIgnite(BlockIgniteEvent ignite) { if (ignite.getIgnitingBlock() == null && ignite.getIgnitingEntity() == null) { return; if (ignite.getIgnitingBlock() == null) { if (ignite.getIgnitingEntity() instanceof Player) { game = BedwarsRel.getInstance().getGameManager() .getGameOfPlayer((Player) ignite.getIgnitingEntity()); } else { game = BedwarsRel.getInstance().getGameManager() .getGameByLocation(ignite.getIgnitingEntity().getLocation()); .getGameByLocation(ignite.getIgnitingBlock().getLocation()); if (ignite.getCause() == IgniteCause.ENDER_CRYSTAL || ignite.getCause() == IgniteCause.LIGHTNING || ignite.getCause() == IgniteCause.SPREAD) { ignite.setCancelled(true); return; if (ignite.getIgnitingEntity() == null) { ignite.setCancelled(true); return; if (!game.getRegion().isPlacedBlock(ignite.getIgnitingBlock()) && ignite.getIgnitingBlock() != null) { game.getRegion().addPlacedBlock(ignite.getIgnitingBlock(), ignite.getIgnitingBlock().getState());
@EventHandler(ignoreCancelled = true) public void igniteblock(BlockIgniteEvent event){ MinigamePlayer ply = null; if(event.getPlayer() != null) ply = pdata.getMinigamePlayer(event.getPlayer()); if(ply == null) return; if(ply.isInMinigame() && (event.getCause() == IgniteCause.FIREBALL || event.getCause() == IgniteCause.FLINT_AND_STEEL)){ Minigame mgm = ply.getMinigame(); RecorderData d = mgm.getBlockRecorder(); if(((d.getWhitelistMode() && d.getWBBlocks().contains(Material.FIRE)) || (!d.getWhitelistMode() && !d.getWBBlocks().contains(Material.FIRE))) && mgm.canBlockPlace()){ d.addBlock(event.getBlock(), pdata.getMinigamePlayer(event.getPlayer())); } else{ event.setCancelled(true); } } }
Block b = event.getBlock(); if (!arena.getRegion().contains(b.getLocation())) return; switch (event.getCause()) { case FLINT_AND_STEEL: if (arena.inEditMode()) return; arena.addBlock(event.getBlock().getRelative(BlockFace.UP)); case EXPLOSION: case LAVA: event.setCancelled(true); break;
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onBlockIgnite(BlockIgniteEvent event) { IgniteCause cause = event.getCause(); Block block = event.getBlock(); World world = block.getWorld(); event.setCancelled(true); return; event.setCancelled(true); return; event.setCancelled(true); return; event.setCancelled(true); return; && event.getPlayer() != null && !plugin.hasPermission(event.getPlayer(), "worldguard.override.lighter")) { event.setCancelled(true); return; event.setCancelled(true); return; || wcfg.disableFireSpreadBlocks.contains(BukkitAdapter.asBlockType(world.getBlockAt(x, y, z - 1).getType()).getId()) || wcfg.disableFireSpreadBlocks.contains(BukkitAdapter.asBlockType(world.getBlockAt(x, y, z + 1).getType()).getId())) { event.setCancelled(true); return;