/** * So far specifically handles these cases: * * 1) Block burnt is tracked * 2) Block burnt is under a tracked block (probably only mushrooms eligible) * 3) Block burnt was a jungle tree, checks for cocoa. * 4) Burnt block had mushroom on top and cocoa on the sides * * @param e The event */ @EventHandler(priority=EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockBurn(BlockBurnEvent e) { Block block = e.getBlock(); if (maybeSideTracked(block)) { trySideBreak(block, BreakType.FIRE, null); } if (maybeBelowTracked(block)) { block = block.getRelative(BlockFace.UP); } Location loc = block.getLocation(); if (!pendingChecks.contains(loc)) { pendingChecks.add(loc); handleBreak(block, BreakType.FIRE, null, null); } }
@EventWrapper public void onBlockBurn(final BlockBurnEvent event) { Match match = PGM.getMatchManager().getMatch(event.getBlock().getWorld()); if(match == null) return; BlockState oldState = event.getBlock().getState(); BlockState newState = BlockStateUtils.toAir(oldState); MatchPlayerState igniterState = null; for(BlockFace face : NEIGHBORS) { Block neighbor = oldState.getBlock().getRelative(face); if(neighbor.getType() == Material.FIRE) { igniterState = blockResolver.getOwner(neighbor); if(igniterState != null) break; } } this.callEvent(event, oldState, newState, igniterState); }
@EventHandler public void onBlockBurn(BlockBurnEvent event) throws InterruptedException { if (disabling) { return; } Block block = event.getBlock(); if (plugin.needsCheck.contains(block)) { plugin.needsCheck.remove(block); } if (plugin.monitorBlocks.contains(block)) { while (plugin.isUpdatingChecks) { Thread.sleep(25); } plugin.monitorBlocks.remove(block); } }
@EventHandler(priority = EventPriority.HIGH) public void onBurn(BlockBurnEvent bbe) { Block block = bbe.getBlock(); if (block == null) { return; } Game game = BedwarsRel.getInstance().getGameManager().getGameByLocation(block.getLocation()); if (game == null) { return; } if (game.getState() == GameState.STOPPED) { return; } bbe.setCancelled(true); }
@EventHandler public void onBlockBurn(BlockBurnEvent e){ RedProtect.get().logger.debug("RPBlockListener - Is BlockBurnEvent event"); if (e.isCancelled()){ return; } Block b = e.getBlock(); Region r = RedProtect.get().rm.getTopRegion(b.getLocation()); if (r != null && !r.canFire()){ e.setCancelled(true); return; } if (!cont.canWorldBreak(b)){ e.setCancelled(true); } }
@EventHandler(priority = EventPriority.HIGH) public void onBlockBurn(final BlockBurnEvent event) { if (event.isCancelled()) return; final Block block = event.getBlock(); // Ok so a frame block is burning // Find the nearest gate! final WorldCoord blockCoord = new WorldCoord(block); final Gate nearestGate = Gates.gateFromFrameAndSurround(blockCoord); if (nearestGate != null) { event.setCancelled(true); } }
@EventHandler(priority = EventPriority.LOW) public void onBlockBurnEvent(BlockBurnEvent event) { bcoord.setFromLocation(event.getBlock().getLocation()); StructureBlock sb = CivGlobal.getStructureBlock(bcoord); if (sb != null) { event.setCancelled(true); return; } RoadBlock rb = CivGlobal.getRoadBlock(bcoord); if (rb != null) { event.setCancelled(true); return; } CampBlock cb = CivGlobal.getCampBlock(bcoord); if (cb != null) { event.setCancelled(true); return; } }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockBurn(BlockBurnEvent event) { Block b = event.getBlock(); Location location = BukkitUtil.getLocation(b.getLocation()); PlotArea area = location.getPlotArea(); if (area == null) { return; } Plot plot = location.getOwnedPlot(); if (plot == null || !plot.getFlag(Flags.BLOCK_BURN, false)) { event.setCancelled(true); return; } }
@EventHandler public void onBlockBurn(BlockBurnEvent event) { Block block = event.getBlock(); if (block.getRelative(BlockFace.UP).getType() == Material.FIRE) { block.getRelative(BlockFace.UP).setType(Material.AIR); } if (block.getRelative(BlockFace.NORTH).getType() == Material.FIRE) { block.getRelative(BlockFace.NORTH).setType(Material.AIR); } if (block.getRelative(BlockFace.SOUTH).getType() == Material.FIRE) { block.getRelative(BlockFace.SOUTH).setType(Material.AIR); } if (block.getRelative(BlockFace.WEST).getType() == Material.FIRE) { block.getRelative(BlockFace.WEST).setType(Material.AIR); } if (block.getRelative(BlockFace.EAST).getType() == Material.FIRE) { block.getRelative(BlockFace.EAST).setType(Material.AIR); } //rather than disabling fire spread, we make it burn itself out by targeting fire blocks and removing them }
@EventHandler(priority = EventPriority.LOWEST) public void onBlockBurn(final BlockBurnEvent event) { final Location location = event.getBlock().getLocation(); if (!reinforcementManager.isWorldActive(location.getWorld().getName())) { return; } // If the block is not reinforced, it is allowed to burn normally. if (!reinforcementManager.isReinforced(location)) { return; } // If the block is reinforced, the burn event is cancelled for the block. event.setCancelled(true); // The block reinforcement is then damaged. reinforcementManager.damageBlock(location, null, BlockSaverDamageCause.FIRE); }
@EventHandler public void onBlockBurn(BlockBurnEvent event) { if (region.contains(event.getBlock().getLocation())) { if (materials == null || materials.contains(event.getBlock().getType())) { event.setCancelled(true); } } }
/** * Prevents fire spread * @param e */ @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onBlockBurn(BlockBurnEvent e) { if (DEBUG) { plugin.getLogger().info(e.getEventName()); } if (!Util.inWorld(e.getBlock())) { //plugin.getLogger().info("DEBUG: Not in world"); return; } if (actionAllowed(e.getBlock().getLocation(), SettingsFlag.FIRE_SPREAD)) { return; } e.setCancelled(true); }
@EventHandler public void BlockBurn(BlockBurnEvent e) { if (ConfigGServerEvent.getConfig().getBoolean("Server.Disable.Burn-block.Enable")) { if (!ConfigGServerEvent.getConfig().getBoolean("Server.Disable.Burn-block.World.All_World")) { if (WorldUtils.getWBB().contains(e.getBlock().getWorld().getName())) { e.setCancelled(true); } } else { e.setCancelled(true); } } }
@EventHandler(ignoreCancelled = false) public void onBlockBurn(cn.nukkit.event.block.BlockBurnEvent event) { if (canIgnore(BlockBurnEvent.getHandlerList())) { return; } cn.nukkit.block.Block burning = event.getBlock(); // Nukkit does not provide ignitingBlock, so we have to use this // deprecated method @SuppressWarnings("deprecation") BlockBurnEvent bukkitEvent = new BlockBurnEvent(PokkitBlock.toBukkit(burning)); callCancellable(event, bukkitEvent); }
@EventHandler public void onBlockBurn(BlockBurnEvent e){ if (e.isCancelled()){ return; } Block b = e.getBlock(); Region r = RedProtect.get().rm.getTopRegion(b.getLocation()); if (r != null){ return; } if (!RPConfig.getGlobalFlagBool(b.getWorld().getName()+".fire-block-damage")){ e.setCancelled(true); } }
@EventHandler(priority = EventPriority.HIGHEST) public void onBlockBurn(BlockBurnEvent e) { boolean cancelled = false; String w = e.getBlock().getWorld().getName(); for (String p : worlds.keySet()) { for (int i = 0; i < worlds.get(p).size(); i++) { if (worlds.get(p).get(i).equals(w)) { if (!Minigame.getMinigameInstance(p).getConfigManager().isBlockBurnAllowed()) { e.setCancelled(true); cancelled = true; break; } } } } if (cancelled) { return; } Block adjBlock = MGUtil.getAttachedSign(e.getBlock()); if (adjBlock != null) { for (Minigame mg : Minigame.getMinigameInstances()) { for (LobbySign l : mg.getLobbyManager().signs.values()) { if (l.getX() == adjBlock.getX() && l.getY() == adjBlock.getY() && l.getZ() == adjBlock.getZ() && l.getWorld().equals(adjBlock.getWorld().getName())) { e.setCancelled(true); break; } } } } }
private void a(World world, int i, int j, int k, int l, Random random, int i1) { int j1 = this.b[Block.getId(world.getType(i, j, k))]; if (random.nextInt(l) < j1) { boolean flag = world.getType(i, j, k) == Blocks.TNT; // CraftBukkit start org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(i, j, k); BlockBurnEvent event = new BlockBurnEvent(theBlock); world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { return; } // CraftBukkit end if (random.nextInt(i1 + 10) < 5 && !world.isRainingAt(i, j, k)) { int k1 = i1 + random.nextInt(5) / 4; if (k1 > 15) { k1 = 15; } world.setTypeAndData(i, j, k, this, k1, 3); } else { world.setAir(i, j, k); } if (flag) { Blocks.TNT.postBreak(world, i, j, k, 1); } } }
@EventHandler public void onBlockBurn(BlockBurnEvent event) { Lot lot = this.module.getLotManager().getLot(event.getBlock().getLocation()); Town town = this.module.getLotManager().getTown(event.getBlock().getLocation()); if(lot != null || town != null) { event.setCancelled(true); } }
@EventHandler public void onBlockBurn(BlockBurnEvent event) { BlockProtection blockProtection = this.module.getProtectManager().getBlockProtection(event.getBlock().getLocation()); if(blockProtection.exists()) { event.setCancelled(true); } }
private void a(World world, int i, int j, int k, int l, Random random, int i1) { int j1 = this.b[world.getTypeId(i, j, k)]; if (random.nextInt(l) < j1) { boolean flag = world.getTypeId(i, j, k) == Block.TNT.id; // CraftBukkit start org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(i, j, k); BlockBurnEvent event = new BlockBurnEvent(theBlock); world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { return; } // CraftBukkit end if (random.nextInt(i1 + 10) < 5 && !world.isRainingAt(i, j, k)) { int k1 = i1 + random.nextInt(5) / 4; if (k1 > 15) { k1 = 15; } world.setTypeIdAndData(i, j, k, this.id, k1, 3); } else { world.setAir(i, j, k); } if (flag) { Block.TNT.postBreak(world, i, j, k, 1); } } }
@EventHandler(ignoreCancelled = true) public void onBlockBurnEvent(BlockBurnEvent event) { if (plugin.getChestSettings().allowDestroyBy(AttackType.FIRE)) { return; } if (isProtected(event.getBlock())) { event.setCancelled(true); } }
@EventHandler(priority = EventPriority.HIGHEST) public void onBlockBurn(BlockBurnEvent event) { Block block = event.getBlock(); Chunk blockChunk = block.getChunk(); if (config.getClaimed(blockChunk)) { event.setCancelled(true); } }
/** * Prevents fire spread * @param e */ @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onBlockBurn(BlockBurnEvent e) { if (DEBUG) { plugin.getLogger().info(e.getEventName()); } if (!inWorld(e.getBlock())) { //plugin.getLogger().info("DEBUG: Not in world"); return; } if (actionAllowed(e.getBlock().getLocation(), SettingsFlag.FIRE_SPREAD)) { return; } e.setCancelled(true); }
/** * On block burn. * * @param event the event */ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onBlockBurn(BlockBurnEvent event) { IDummyLand land = Factoid.getThisPlugin().iLands().getLandOrOutsideArea(event.getBlock().getLocation()); if ((land.getFlagAndInherit(FlagList.FIRESPREAD.getFlagType()).getValueBoolean() == false) || (land.getFlagAndInherit(FlagList.FIRE.getFlagType()).getValueBoolean() == false)) { event.setCancelled(true); } }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockBurn(BlockBurnEvent event) { this.setAndLog(BlockBurn.class, event.getBlock().getState(), AIR); logAttachedBlocks(this, this.module.getCore().getEventManager(), event.getBlock(), null); logFallingBlocks(this, this.module.getCore().getEventManager(), event.getBlock(), null); }
private void a(World world, BlockPosition blockposition, int i, Random random, int j) { int k = this.c(world.getType(blockposition).getBlock()); if (random.nextInt(i) < k) { IBlockData iblockdata = world.getType(blockposition); // CraftBukkit start org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); BlockBurnEvent event = new BlockBurnEvent(theBlock); world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { return; } // CraftBukkit end if (random.nextInt(j + 10) < 5 && !world.isRainingAt(blockposition)) { int l = j + random.nextInt(5) / 4; if (l > 15) { l = 15; } world.setTypeAndData(blockposition, this.getBlockData().set(BlockFire.AGE, Integer.valueOf(l)), 3); } else { fireExtinguished(world, blockposition); // CraftBukkit } if (iblockdata.getBlock() == Blocks.TNT) { Blocks.TNT.postBreak(world, blockposition, iblockdata.set(BlockTNT.EXPLODE, Boolean.valueOf(true))); } } }
/** * Called when a block burns * Nearly the same as blockBreakEvent */ @EventHandler public void burnListener(BlockBurnEvent e) { Block block = e.getBlock(); if (factoryMan.factoryExistsAt(block.getLocation())) { if (factoryMan.factoryExistsAt(block.getLocation())) { destroyFactoryAt(block); } } }
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onBlockBurn(final BlockBurnEvent event) { final GeneralRegion region = this.getPlugin().getDb().getPriorByLocation(event.getBlock().getLocation()); if (region != null && region.getFlag(Flag.FIRE)) { event.setCancelled(true); } }
@EventHandler public void onBlockBurn(BlockBurnEvent event) { Block b = event.getBlock(); ArenaManager am = SimpleSurvivalGames.instance.getArenaManager(); // Capture the block for(Arena a : am.getArenas()) if(a.isArenaCuboidSet()) if(a.getArenaCuboid().isInsideCuboid(b)) if(a.getState().equals(ArenaState.PLAYING) || a.getState().equals(ArenaState.STARTING)) a.getPlayerBlockManager().addBlock(b); }
private void a(World world, int i, int j, int k, int l, Random random, int i1) { int j1 = this.b[world.getTypeId(i, j, k)]; if (random.nextInt(l) < j1) { boolean flag = world.getTypeId(i, j, k) == Block.TNT.id; // CraftBukkit start org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(i, j, k); BlockBurnEvent event = new BlockBurnEvent(theBlock); world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { return; } // CraftBukkit end if (random.nextInt(i1 + 10) < 5 && !world.F(i, j, k)) { int k1 = i1 + random.nextInt(5) / 4; if (k1 > 15) { k1 = 15; } world.setTypeIdAndData(i, j, k, this.id, k1, 3); } else { world.setAir(i, j, k); } if (flag) { Block.TNT.postBreak(world, i, j, k, 1); } } }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockBurn(final BlockBurnEvent event) { final ProtectHolder settings = prot.getSettings(); if (settings.getData().getPrevent().isFirespread()) { event.setCancelled(true); } }
@EventHandler(priority = EventPriority.HIGH) public void noFire(final BlockBurnEvent event) { event.setCancelled(true); }
@EventHandler(ignoreCancelled = true) public void onBlockBurn(BlockBurnEvent event) { this.post(event, event.getBlock().getState(), this.applyAir(event.getBlock())); }
@EventHandler public void onBlockBurn(BlockBurnEvent event) { event.setCancelled(true); }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockBurn(BlockBurnEvent event) { RollbackAgent.checkBlockChange(event.getBlock().getLocation(), event.getBlock().getState(), event); }
@EventHandler(priority = EventPriority.LOWEST) public void onBlockBurn (BlockBurnEvent burnEvent) { if(!GriefPrevention.instance.config_fireDestroys) { burnEvent.setCancelled(true); Block block = burnEvent.getBlock(); Block [] adjacentBlocks = new Block [] { block.getRelative(BlockFace.UP), block.getRelative(BlockFace.DOWN), block.getRelative(BlockFace.NORTH), block.getRelative(BlockFace.SOUTH), block.getRelative(BlockFace.EAST), block.getRelative(BlockFace.WEST) }; //pro-actively put out any fires adjacent the burning block, to reduce future processing here for(int i = 0; i < adjacentBlocks.length; i++) { Block adjacentBlock = adjacentBlocks[i]; if(adjacentBlock.getType() == Material.FIRE && adjacentBlock.getRelative(BlockFace.DOWN).getType() != Material.NETHERRACK) { adjacentBlock.setType(Material.AIR); } } Block aboveBlock = block.getRelative(BlockFace.UP); if(aboveBlock.getType() == Material.FIRE) { aboveBlock.setType(Material.AIR); } return; } //don't track in worlds where claims are not enabled if(!GriefPrevention.instance.claimsEnabledForWorld(burnEvent.getBlock().getWorld())) return; //never burn claimed blocks, regardless of settings if(this.dataStore.getClaimAt(burnEvent.getBlock().getLocation(), false, null) != null) { burnEvent.setCancelled(true); } }