@EventHandler(priority = EventPriority.HIGH) public void onBlockExplode(BlockExplodeEvent e) { Iterator<Block> iter = e.blockList().iterator(); while (iter.hasNext()) { Block b = iter.next(); if (plugin.getAllowedInventories().contains(b.getType())) { Sign s = findShopSign(b); if (s != null && ShopType.getType(s).isProtectedFromExplosions()) { iter.remove(); } } else if (b.getState() instanceof Sign && findShopChest(b) != null) { iter.remove(); } } }
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST) public void onBlockExplode(BlockExplodeEvent event) { World world = event.getBlock().getWorld(); if(!DiamondGuarantee.instance.worldSettingsManager.Get(world).generateDiamonds) return; List<Block> blocks = event.blockList(); for(int i = 0; i < blocks.size(); i++) { Block block = blocks.get(i); if(block.getType() == Material.DIAMOND_ORE) { blocks.remove(i--); } } }
@EventHandler public void onBlockExplode(BlockExplodeEvent e){ RedProtect.get().logger.debug("Is BlockListener - BlockExplodeEvent event"); List<Block> toRemove = new ArrayList<>(); for (Block b:e.blockList()){ Region r = RedProtect.get().rm.getTopRegion(b.getLocation()); if (!cont.canWorldBreak(b)){ toRemove.add(b); continue; } if (r != null && !r.canFire()){ toRemove.add(b); } } if (!toRemove.isEmpty()){ e.blockList().removeAll(toRemove); } }
@EventHandler public void onBlockExplode(BlockExplodeEvent 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.setYield(0); event.setCancelled(true); return; } for(Block block : event.blockList()) { Lot l = this.module.getLotManager().getLot(block.getLocation()); Town t = this.module.getLotManager().getTown(block.getLocation()); if(l != null || t != null) { event.setYield(0); event.setCancelled(true); break; } } }
@EventHandler public void onBlockExplode(BlockExplodeEvent event) { BlockProtection blockProtection = this.module.getProtectManager().getBlockProtection(event.getBlock().getLocation()); if(blockProtection.exists()) { event.setYield(0); event.setCancelled(true); return; } for(Block block : event.blockList()) { BlockProtection p = this.module.getProtectManager().getBlockProtection(block.getLocation()); if(p != null) { event.setYield(0); event.setCancelled(true); break; } } }
/** * Block explode event handler<br> * Make death chests explosion proof if chest-protection is enabled * @param event */ @EventHandler public void onBlockExplode(BlockExplodeEvent event) { // if chest-protection is not enabled in config, do nothing and return if (!plugin.getConfig().getBoolean("chest-protection")) { return; } // iterate through all blocks in explosion event and remove those that are DeathChestBlocks ArrayList<Block> blocks = new ArrayList<Block>(event.blockList()); for (Block block : blocks) { if (DeathChestBlock.isDeathChestBlock(block)) { event.blockList().remove(block); } } }
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onBlockExplode(BlockExplodeEvent e) { for (Block b : e.blockList()) { if (isIdContainerBlock(b.getTypeId())) { updateDuctNeighborBlockSync(b, false); } } }
@EventHandler public void onBE(BlockExplodeEvent e) { if (!Utils.isArenaWorld(e.getBlock().getWorld())) { return; } e.setCancelled(true); }
/** * Catch explosions * * @param event */ @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onExplodingThings(BlockExplodeEvent event) { plugin.getTracking().trackBreak(event.getBlock().getLocation()); debug("Explosion event at {0}", event.getBlock().getLocation()); for (Block b : event.blockList()) { if (b != null) { plugin.getTracking().trackBreak(b.getLocation()); } } }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void bedBreakExplosion(BlockExplodeEvent event) { if (config.get("lobby").getBool()) return; for (Block b : event.blockList()) { bedBreak(b); } }
@EventHandler public void onBlockExplode(BlockExplodeEvent e) { if (plugin.getShopChestConfig().explosion_protection) { ArrayList<Block> bl = new ArrayList<>(e.blockList()); for (Block b : bl) { if (b.getType().equals(Material.CHEST) || b.getType().equals(Material.TRAPPED_CHEST)) { if (plugin.getShopUtils().isShop(b.getLocation())) e.blockList().remove(b); } } } }
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onBlockExplode(BlockExplodeEvent event) { Location location = BukkitUtil.adapt(event.getBlock().getLocation()); PlotMapInfo pmi = manager.getMap(location); if (pmi != null && pmi.isDisableExplosion()) { event.setCancelled(true); } else { PlotId id = manager.getPlotId(location); if (id == null) { event.setCancelled(true); } } }
@EventHandler(ignoreCancelled = true) public void onEntityExplode(BlockExplodeEvent event) { if (event == null || ChunkManager.getInstance().getDisabledWorlds().contains(event.getBlock().getLocation().getWorld().getName())) { return; // do not do anything in case explosions get cancelled } final Block detonatorBlock = event.getBlock(); if (detonatorBlock == null) { return; } if (detonatorBlock.hasMetadata("ObbyEntity")) { return; } if (event.getYield() <= 0) { return; } // feeling batty?! Spawn a bat to tie onto the EntityExplodeEvent. try { Bat bat = (Bat) Bukkit.getWorld(detonatorBlock.getWorld().getName()).spawnEntity(detonatorBlock.getLocation(), EntityType.BAT); if (bat != null) { bat.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 100, 1), true); } // Construct a new event but don't call it. EntityExplodeEvent entityExplodeEvent = new EntityExplodeEvent(bat, event.getBlock().getLocation(), event.blockList(), event.getYield()); ChunkManager.getInstance().handleExplosion(entityExplodeEvent, event.getBlock().getLocation()); if (bat != null) { bat.remove(); // bye } } catch (Exception e) { ObsidianDestroyer.debug(e.toString()); } }
@EventHandler(priority=EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockExplode(BlockExplodeEvent e) { doMultiblockHandler(e.blockList(), BreakType.EXPLOSION, null); }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onExplode(BlockExplodeEvent evt) { handleExplode(evt, evt.blockList()); }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void blockExplode(BlockExplodeEvent event) { render(event.getBlock().getLocation()); }
@EventHandler public void onExplode(BlockExplodeEvent e) { if (NexusModule.getInstance().containsNexus((e.blockList()))) { e.setCancelled(true); } }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockExplode(BlockExplodeEvent e) { handleExplosionSync(e.blockList()); }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) void onBlockExplode(BlockExplodeEvent e) { e.blockList().removeAll(explosionHandler(e.blockList())); }
@EventHandler public void onBlockExplodeEvent(BlockExplodeEvent event) { Block b=event.getBlock(); if(isChest(b)) handleChestDestruction(b, null); }
@EventHandler public void onBlockExplosion(BlockExplodeEvent event) { Fireball fireball = (Fireball) event.getBlock().getWorld().spawnEntity(event.getBlock().getLocation(), EntityType.FIREBALL); fireball.setYield(0.0f); Bukkit.getServer().getPluginManager().callEvent(new EntityExplodeEvent(fireball, event.getBlock().getLocation(), event.blockList(), event.getYield())); fireball.remove(); }