Program: 134057
Project: 134057
Buggy source:
public static boolean isRegionProtectedFromBuildPostCache(Player player,String ability,Location loc){
  boolean allowharmless=plugin.getConfig().getBoolean("String_Node_Str");
  boolean respectWorldGuard=plugin.getConfig().getBoolean("String_Node_Str");
  boolean respectPreciousStones=plugin.getConfig().getBoolean("String_Node_Str");
  boolean respectFactions=plugin.getConfig().getBoolean("String_Node_Str");
  boolean respectTowny=plugin.getConfig().getBoolean("String_Node_Str");
  boolean respectGriefPrevention=plugin.getConfig().getBoolean("String_Node_Str");
  boolean respectLWC=plugin.getConfig().getBoolean("String_Node_Str");
  Set<String> ignite=AbilityModuleManager.igniteabilities;
  Set<String> explode=AbilityModuleManager.explodeabilities;
  if (ability == null && allowharmless)   return false;
  if (isHarmlessAbility(ability) && allowharmless)   return false;
  PluginManager pm=Bukkit.getPluginManager();
  Plugin wgp=pm.getPlugin("String_Node_Str");
  Plugin psp=pm.getPlugin("String_Node_Str");
  Plugin fcp=pm.getPlugin("String_Node_Str");
  Plugin twnp=pm.getPlugin("String_Node_Str");
  Plugin gpp=pm.getPlugin("String_Node_Str");
  Plugin massivecore=pm.getPlugin("String_Node_Str");
  Plugin lwc=pm.getPlugin("String_Node_Str");
  for (  Location location : new Location[]{loc,player.getLocation()}) {
    World world=location.getWorld();
    if (lwc != null && respectLWC) {
      LWCPlugin lwcp=(LWCPlugin)lwc;
      LWC lwc2=lwcp.getLWC();
      Protection protection=lwc2.getProtectionCache().getProtection(location.getBlock());
      if (protection != null) {
        if (!lwc2.canAccessProtection(player,protection)) {
          return true;
        }
      }
    }
    if (wgp != null && respectWorldGuard && !player.hasPermission("String_Node_Str" + world.getName())) {
      WorldGuardPlugin wg=(WorldGuardPlugin)Bukkit.getPluginManager().getPlugin("String_Node_Str");
      if (!player.isOnline())       return true;
      if (ignite.contains(ability)) {
        if (!wg.hasPermission(player,"String_Node_Str")) {
          if (wg.getGlobalStateManager().get(world).blockLighter)           return true;
        }
      }
      if (explode.contains(ability)) {
        if (wg.getGlobalStateManager().get(location.getWorld()).blockTNTExplosions)         return true;
        if (!wg.getRegionContainer().createQuery().testBuild(location,player,DefaultFlag.TNT))         return true;
      }
      if (!wg.canBuild(player,location.getBlock())) {
        return true;
      }
    }
    if (psp != null && respectPreciousStones) {
      PreciousStones ps=(PreciousStones)psp;
      if (ignite.contains(ability)) {
        if (ps.getForceFieldManager().hasSourceField(location,FieldFlag.PREVENT_FIRE))         return true;
      }
      if (explode.contains(ability)) {
        if (ps.getForceFieldManager().hasSourceField(location,FieldFlag.PREVENT_EXPLOSIONS))         return true;
      }
      if (!PreciousStones.API().canBreak(player,location)) {
        return true;
      }
    }
    if (fcp != null && massivecore != null && respectFactions) {
      if (!EngineMain.canPlayerBuildAt(player,PS.valueOf(loc.getBlock()),false)) {
        return true;
      }
 else {
        return false;
      }
    }
    if (twnp != null && respectTowny) {
      Towny twn=(Towny)twnp;
      WorldCoord worldCoord;
      try {
        TownyWorld tWorld=TownyUniverse.getDataSource().getWorld(world.getName());
        worldCoord=new WorldCoord(tWorld.getName(),Coord.parseCoord(location));
        boolean bBuild=PlayerCacheUtil.getCachePermission(player,location,3,(byte)0,TownyPermission.ActionType.BUILD);
        if (ignite.contains(ability)) {
        }
        if (explode.contains(ability)) {
        }
        if (!bBuild) {
          PlayerCache cache=twn.getCache(player);
          TownBlockStatus status=cache.getStatus();
          if (((status == TownBlockStatus.ENEMY) && TownyWarConfig.isAllowingAttacks())) {
            try {
              TownyWar.callAttackCellEvent(twn,player,location.getBlock(),worldCoord);
            }
 catch (            Exception e) {
              TownyMessaging.sendErrorMsg(player,e.getMessage());
            }
            return true;
          }
 else           if (status == TownBlockStatus.WARZONE) {
          }
 else {
            return true;
          }
          if ((cache.hasBlockErrMsg()))           TownyMessaging.sendErrorMsg(player,cache.getBlockErrMsg());
        }
      }
 catch (      Exception e1) {
        TownyMessaging.sendErrorMsg(player,TownySettings.getLangString("String_Node_Str"));
      }
    }
    if (gpp != null && respectGriefPrevention) {
      Material type=player.getWorld().getBlockAt(location).getType();
      if (type == null)       type=Material.AIR;
      String reason=GriefPrevention.instance.allowBuild(player,location);
      Claim claim=GriefPrevention.instance.dataStore.getClaimAt(loc,true,null);
      if (ignite.contains(ability)) {
      }
      if (explode.contains(ability)) {
      }
      if (reason != null && claim.siegeData != null)       return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isRegionProtectedFromBuildPostCache(Player player,String ability,Location loc){
  boolean allowharmless=plugin.getConfig().getBoolean("String_Node_Str");
  boolean respectWorldGuard=plugin.getConfig().getBoolean("String_Node_Str");
  boolean respectPreciousStones=plugin.getConfig().getBoolean("String_Node_Str");
  boolean respectFactions=plugin.getConfig().getBoolean("String_Node_Str");
  boolean respectTowny=plugin.getConfig().getBoolean("String_Node_Str");
  boolean respectGriefPrevention=plugin.getConfig().getBoolean("String_Node_Str");
  boolean respectLWC=plugin.getConfig().getBoolean("String_Node_Str");
  Set<String> ignite=AbilityModuleManager.igniteabilities;
  Set<String> explode=AbilityModuleManager.explodeabilities;
  if (ability == null && allowharmless)   return false;
  if (isHarmlessAbility(ability) && allowharmless)   return false;
  PluginManager pm=Bukkit.getPluginManager();
  Plugin wgp=pm.getPlugin("String_Node_Str");
  Plugin psp=pm.getPlugin("String_Node_Str");
  Plugin fcp=pm.getPlugin("String_Node_Str");
  Plugin twnp=pm.getPlugin("String_Node_Str");
  Plugin gpp=pm.getPlugin("String_Node_Str");
  Plugin massivecore=pm.getPlugin("String_Node_Str");
  Plugin lwc=pm.getPlugin("String_Node_Str");
  for (  Location location : new Location[]{loc,player.getLocation()}) {
    World world=location.getWorld();
    if (lwc != null && respectLWC) {
      LWCPlugin lwcp=(LWCPlugin)lwc;
      LWC lwc2=lwcp.getLWC();
      Protection protection=lwc2.getProtectionCache().getProtection(location.getBlock());
      if (protection != null) {
        if (!lwc2.canAccessProtection(player,protection)) {
          return true;
        }
      }
    }
    if (wgp != null && respectWorldGuard && !player.hasPermission("String_Node_Str" + world.getName())) {
      WorldGuardPlugin wg=(WorldGuardPlugin)Bukkit.getPluginManager().getPlugin("String_Node_Str");
      if (!player.isOnline())       return true;
      if (ignite.contains(ability)) {
        if (!wg.hasPermission(player,"String_Node_Str")) {
          if (wg.getGlobalStateManager().get(world).blockLighter)           return true;
        }
      }
      if (explode.contains(ability)) {
        if (wg.getGlobalStateManager().get(location.getWorld()).blockTNTExplosions)         return true;
        if (!wg.getRegionContainer().createQuery().testBuild(location,player,DefaultFlag.TNT))         return true;
      }
      if (!wg.canBuild(player,location.getBlock())) {
        return true;
      }
    }
    if (psp != null && respectPreciousStones) {
      PreciousStones ps=(PreciousStones)psp;
      if (ignite.contains(ability)) {
        if (ps.getForceFieldManager().hasSourceField(location,FieldFlag.PREVENT_FIRE))         return true;
      }
      if (explode.contains(ability)) {
        if (ps.getForceFieldManager().hasSourceField(location,FieldFlag.PREVENT_EXPLOSIONS))         return true;
      }
      if (!PreciousStones.API().canBreak(player,location)) {
        return true;
      }
    }
    if (fcp != null && massivecore != null && respectFactions) {
      return !EngineMain.canPlayerBuildAt(player,PS.valueOf(loc.getBlock()),false);
    }
    if (twnp != null && respectTowny) {
      Towny twn=(Towny)twnp;
      WorldCoord worldCoord;
      try {
        TownyWorld tWorld=TownyUniverse.getDataSource().getWorld(world.getName());
        worldCoord=new WorldCoord(tWorld.getName(),Coord.parseCoord(location));
        boolean bBuild=PlayerCacheUtil.getCachePermission(player,location,3,(byte)0,TownyPermission.ActionType.BUILD);
        if (ignite.contains(ability)) {
        }
        if (explode.contains(ability)) {
        }
        if (!bBuild) {
          PlayerCache cache=twn.getCache(player);
          TownBlockStatus status=cache.getStatus();
          if (((status == TownBlockStatus.ENEMY) && TownyWarConfig.isAllowingAttacks())) {
            try {
              TownyWar.callAttackCellEvent(twn,player,location.getBlock(),worldCoord);
            }
 catch (            Exception e) {
              TownyMessaging.sendErrorMsg(player,e.getMessage());
            }
            return true;
          }
 else           if (status == TownBlockStatus.WARZONE) {
          }
 else {
            return true;
          }
          if ((cache.hasBlockErrMsg()))           TownyMessaging.sendErrorMsg(player,cache.getBlockErrMsg());
        }
      }
 catch (      Exception e1) {
        TownyMessaging.sendErrorMsg(player,TownySettings.getLangString("String_Node_Str"));
      }
    }
    if (gpp != null && respectGriefPrevention) {
      Material type=player.getWorld().getBlockAt(location).getType();
      if (type == null)       type=Material.AIR;
      String reason=GriefPrevention.instance.allowBuild(player,location);
      Claim claim=GriefPrevention.instance.dataStore.getClaimAt(loc,true,null);
      if (ignite.contains(ability)) {
      }
      if (explode.contains(ability)) {
      }
      if (reason != null && claim.siegeData != null)       return true;
    }
  }
  return false;
}