示例#1
0
 @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
 public void onBlockBurn(BlockBurnEvent event) {
   ZoneManager manager = m_plugin.getZoneManager();
   if (manager.zoneExists(event.getBlock().getLocation())) {
     event.setCancelled(true);
   }
 }
 @EventHandler(priority = EventPriority.HIGH)
 public void onBlockBurn(BlockBurnEvent event) {
   if (!TotalFreedomMod.allowFireSpread) {
     event.setCancelled(true);
     return;
   }
 }
 @EventHandler(ignoreCancelled = true)
 public void onBlockBurn(BlockBurnEvent event) {
   Block block = event.getBlock();
   if (LotteryManager.isSignRegistered(block) || !checkBlockBroken(block)) {
     event.setCancelled(true);
     return;
   }
 }
  @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);
    }
  }
  /**
   * Called when a block is destroyed from burning
   *
   * @param event Relevant event details
   */
  @Override
  public void onBlockBurn(BlockBurnEvent event) {

    if (event.isCancelled()) {
      return;
    }

    ConfigurationManager cfg = plugin.getGlobalConfiguration();
    WorldConfiguration wcfg = cfg.get(event.getBlock().getWorld());

    if (wcfg.disableFireSpread) {
      event.setCancelled(true);
      return;
    }

    if (wcfg.fireSpreadDisableToggle) {
      event.setCancelled(true);
      return;
    }

    if (wcfg.disableFireSpreadBlocks.size() > 0) {
      Block block = event.getBlock();

      if (wcfg.disableFireSpreadBlocks.contains(block.getTypeId())) {
        event.setCancelled(true);
        return;
      }
    }

    if (wcfg.useRegions) {
      Block block = event.getBlock();
      Vector pt = toVector(block);
      RegionManager mgr = plugin.getGlobalRegionManager().get(block.getWorld());
      ApplicableRegionSet set = mgr.getApplicableRegions(pt);

      if (!set.allows(DefaultFlag.FIRE_SPREAD)) {
        event.setCancelled(true);
        return;
      }
    }
  }
 /* (non-Javadoc)
  * @see org.bukkit.event.block.BlockListener#onBlockBurn(org.bukkit.event.block.BlockBurnEvent)
  */
 @EventHandler(priority = EventPriority.LOWEST)
 public void onBlockBurn(final BlockBurnEvent event) {
   if (!event.isCancelled()
       && (event.getBlock() != null)
       && BlockBurn.handleBlockBurn(event.getBlock())) {
     event.setCancelled(true);
     WXLogger.prettyLog(
         Level.FINE,
         false,
         "Cancelled BlockBurnEvent on " + event.getBlock().getWorld().getName());
   }
 }
  /*
   * Called when a block is destroyed from burning.
   */
  @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
  public void onBlockBurn(BlockBurnEvent event) {
    ConfigurationManager cfg = plugin.getGlobalStateManager();
    WorldConfiguration wcfg = cfg.get(event.getBlock().getWorld());

    if (cfg.activityHaltToggle) {
      event.setCancelled(true);
      return;
    }

    if (wcfg.disableFireSpread) {
      event.setCancelled(true);
      return;
    }

    if (wcfg.fireSpreadDisableToggle) {
      Block block = event.getBlock();
      event.setCancelled(true);
      checkAndDestroyAround(
          block.getWorld(), block.getX(), block.getY(), block.getZ(), BlockID.FIRE);
      return;
    }

    if (wcfg.disableFireSpreadBlocks.size() > 0) {
      Block block = event.getBlock();

      if (wcfg.disableFireSpreadBlocks.contains(block.getTypeId())) {
        event.setCancelled(true);
        checkAndDestroyAround(
            block.getWorld(), block.getX(), block.getY(), block.getZ(), BlockID.FIRE);
        return;
      }
    }

    if (wcfg.isChestProtected(event.getBlock())) {
      event.setCancelled(true);
      return;
    }

    if (wcfg.useRegions) {
      Block block = event.getBlock();
      int x = block.getX();
      int y = block.getY();
      int z = block.getZ();
      Vector pt = toVector(block);
      RegionManager mgr = plugin.getGlobalRegionManager().get(block.getWorld());
      ApplicableRegionSet set = mgr.getApplicableRegions(pt);

      if (!set.allows(DefaultFlag.FIRE_SPREAD)) {
        checkAndDestroyAround(block.getWorld(), x, y, z, BlockID.FIRE);
        event.setCancelled(true);
        return;
      }
    }
  }
 @EventHandler
 public void BlockBurnEvent(BlockBurnEvent event) {
   if (!arena.getRegion().isInside(event.getBlock().getLocation()) || arena.getEditMode()) return;
   if (arena.getArena().isInside(event.getBlock().getLocation()) && arena.isRunning()) return;
   event.setCancelled(true);
 }