Program: 34043
Project: 34043
Buggy source:
/** 
 * Checks if a player has enough for a challenge. Supports two types of checks, inventory and island. Removes items if required.
 * @param player
 * @param challenge
 * @param type
 * @return true if the player has everything required
 */
@SuppressWarnings("String_Node_Str") public boolean hasRequired(final Player player,final String challenge,final String type){
  double moneyReq=0D;
  if (Settings.useEconomy) {
    moneyReq=getChallengeConfig().getDouble("String_Node_Str" + challenge + "String_Node_Str",0D);
    if (moneyReq > 0D) {
      if (!VaultHelper.econ.has(player,moneyReq)) {
        player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).challengeserrorNotEnoughItems);
        player.sendMessage(ChatColor.RED + getChallengeConfig().getString("String_Node_Str" + challenge + "String_Node_Str"));
        return false;
      }
    }
  }
  final String[] reqList=getChallengeConfig().getString("String_Node_Str" + challenge + "String_Node_Str").split("String_Node_Str");
  if (type.equalsIgnoreCase("String_Node_Str")) {
    List<ItemStack> toBeRemoved=new ArrayList<ItemStack>();
    Material reqItem;
    int reqAmount=0;
    for (    final String s : reqList) {
      final String[] part=s.split("String_Node_Str");
      if (part.length == 2) {
        try {
          if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
          if (StringUtils.isNumeric(part[0])) {
            reqItem=Material.getMaterial(Integer.parseInt(part[0]));
          }
 else {
            reqItem=Material.getMaterial(part[0].toUpperCase());
          }
          reqAmount=Integer.parseInt(part[1]);
          ItemStack item=new ItemStack(reqItem);
          if (!player.getInventory().contains(reqItem)) {
            return false;
          }
 else {
            int amount=0;
            for (            Entry<Integer,? extends ItemStack> en : player.getInventory().all(reqItem).entrySet()) {
              ItemStack i=en.getValue();
              if (i.getDurability() == 0 || (reqItem == Material.MAP && i.getType() == Material.MAP)) {
                i.setItemMeta(null);
                player.getInventory().setItem(en.getKey(),i);
                if ((amount + i.getAmount()) < reqAmount) {
                  toBeRemoved.add(i.clone());
                  amount+=i.getAmount();
                }
 else                 if ((amount + i.getAmount()) == reqAmount) {
                  toBeRemoved.add(i.clone());
                  amount+=i.getAmount();
                  break;
                }
 else {
                  item.setAmount(reqAmount - amount);
                  item.setDurability(i.getDurability());
                  toBeRemoved.add(item);
                  amount+=i.getAmount();
                  break;
                }
              }
            }
            if (amount < reqAmount) {
              return false;
            }
          }
        }
 catch (        Exception e) {
          plugin.getLogger().severe("String_Node_Str" + s + "String_Node_Str");
          player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorCommandNotReady);
          String materialList="String_Node_Str";
          boolean hint=false;
          for (          Material m : Material.values()) {
            materialList+=m.toString() + "String_Node_Str";
            if (m.toString().contains(s.substring(0,3).toUpperCase())) {
              plugin.getLogger().severe("String_Node_Str" + m.toString() + "String_Node_Str");
              hint=true;
            }
          }
          if (!hint) {
            plugin.getLogger().severe("String_Node_Str" + s + "String_Node_Str");
            plugin.getLogger().severe(materialList.substring(0,materialList.length() - 1));
          }
 else {
            plugin.getLogger().severe("String_Node_Str");
          }
          return false;
        }
      }
 else       if (part.length == 3) {
        try {
          if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
          if (StringUtils.isNumeric(part[0])) {
            reqItem=Material.getMaterial(Integer.parseInt(part[0]));
          }
 else {
            reqItem=Material.getMaterial(part[0].toUpperCase());
          }
          reqAmount=Integer.parseInt(part[2]);
          int reqDurability=Integer.parseInt(part[1]);
          int count=reqAmount;
          ItemStack item=new ItemStack(reqItem);
          if (reqItem.equals(Material.POTION)) {
            ItemStack[] playerInv=player.getInventory().getContents();
            for (            ItemStack i : playerInv) {
              if (i != null && i.getType().equals(Material.POTION)) {
                if (i.getDurability() == reqDurability) {
                  item=i.clone();
                  if (item.getAmount() > reqAmount) {
                    item.setAmount(reqAmount);
                  }
                  count=count - item.getAmount();
                  toBeRemoved.add(item);
                }
              }
              if (count == 0) {
                break;
              }
            }
            if (count > 0) {
              return false;
            }
          }
 else {
            item.setDurability((short)reqDurability);
            int amount=0;
            for (            Entry<Integer,? extends ItemStack> en : player.getInventory().all(reqItem).entrySet()) {
              ItemStack i=en.getValue();
              if (i.getDurability() == reqDurability) {
                i.setItemMeta(null);
                player.getInventory().setItem(en.getKey(),i);
                if ((amount + i.getAmount()) < reqAmount) {
                  toBeRemoved.add(i.clone());
                  amount+=i.getAmount();
                }
 else                 if ((amount + i.getAmount()) == reqAmount) {
                  toBeRemoved.add(i.clone());
                  amount+=i.getAmount();
                  break;
                }
 else {
                  item.setAmount(reqAmount - amount);
                  item.setDurability(i.getDurability());
                  toBeRemoved.add(item);
                  amount+=i.getAmount();
                  break;
                }
              }
            }
            if (amount < reqAmount) {
              return false;
            }
          }
        }
 catch (        Exception e) {
          plugin.getLogger().severe("String_Node_Str" + s + "String_Node_Str");
          player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorCommandNotReady);
          if (part[0].equalsIgnoreCase("String_Node_Str")) {
            plugin.getLogger().severe("String_Node_Str");
            for (            PotionType p : PotionType.values()) {
              plugin.getLogger().info(p.toString() + "String_Node_Str" + p.getDamageValue());
            }
          }
 else {
            String materialList="String_Node_Str";
            boolean hint=false;
            for (            Material m : Material.values()) {
              materialList+=m.toString() + "String_Node_Str";
              if (m.toString().contains(s.substring(0,3))) {
                plugin.getLogger().severe("String_Node_Str" + m.toString() + "String_Node_Str");
                hint=true;
              }
            }
            if (!hint) {
              plugin.getLogger().severe("String_Node_Str" + s + "String_Node_Str");
              plugin.getLogger().severe(materialList.substring(0,materialList.length() - 1));
            }
 else {
              plugin.getLogger().severe("String_Node_Str");
            }
            return false;
          }
          return false;
        }
      }
 else       if (part.length == 6) {
        try {
          if (StringUtils.isNumeric(part[0])) {
            reqItem=Material.getMaterial(Integer.parseInt(part[0]));
          }
 else {
            reqItem=Material.getMaterial(part[0].toUpperCase());
          }
          reqAmount=Integer.parseInt(part[5]);
          ItemStack item=new ItemStack(reqItem);
          int count=reqAmount;
          if (reqItem == Material.POTION) {
            ItemStack[] playerInv=player.getInventory().getContents();
            for (            ItemStack i : playerInv) {
              if (i != null && i.getType().equals(Material.POTION)) {
                Potion p=fromDamage(i.getDurability());
                PotionType typeCheck=PotionType.valueOf(part[1].toUpperCase());
                if (p.getType().equals(typeCheck)) {
                  if (part[2].isEmpty() || p.getLevel() == Integer.valueOf(part[2])) {
                    if (part[4].isEmpty() || (p.isSplash() && part[4].equalsIgnoreCase("String_Node_Str")) || (!p.isSplash() && part[4].equalsIgnoreCase("String_Node_Str"))) {
                      if (part[3].isEmpty() || (p.hasExtendedDuration() && part[3].equalsIgnoreCase("String_Node_Str")) || (!p.hasExtendedDuration() && part[3].equalsIgnoreCase("String_Node_Str"))) {
                        item=i.clone();
                        if (item.getAmount() > reqAmount) {
                          item.setAmount(reqAmount);
                        }
                        count=count - item.getAmount();
                        toBeRemoved.add(item);
                      }
                    }
                  }
                }
              }
              if (count <= 0) {
                break;
              }
            }
            if (count > 0) {
              return false;
            }
          }
 else {
            plugin.getLogger().severe("String_Node_Str" + s + "String_Node_Str");
          }
        }
 catch (        Exception e) {
          plugin.getLogger().severe("String_Node_Str" + s + "String_Node_Str");
          player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorCommandNotReady);
          if (part[0].equalsIgnoreCase("String_Node_Str")) {
            plugin.getLogger().severe("String_Node_Str");
            plugin.getLogger().severe("String_Node_Str");
            plugin.getLogger().severe("String_Node_Str");
            plugin.getLogger().severe("String_Node_Str");
            plugin.getLogger().severe("String_Node_Str");
            plugin.getLogger().severe("String_Node_Str");
            plugin.getLogger().severe("String_Node_Str");
            plugin.getLogger().severe("String_Node_Str");
            String potionNames="String_Node_Str";
            for (            PotionType p : PotionType.values()) {
              potionNames+=p.toString() + "String_Node_Str";
            }
            plugin.getLogger().severe(potionNames.substring(0,potionNames.length() - 2));
          }
          return false;
        }
      }
    }
    if (getChallengeConfig().getBoolean("String_Node_Str" + challenge + "String_Node_Str")) {
      for (      ItemStack i : toBeRemoved) {
        HashMap<Integer,ItemStack> leftOver=player.getInventory().removeItem(i);
        if (!leftOver.isEmpty()) {
          plugin.getLogger().warning("String_Node_Str" + challenge + "String_Node_Str"+ player.getName()+ "String_Node_Str");
          for (          ItemStack left : leftOver.values()) {
            plugin.getLogger().info(left.toString());
          }
          return false;
        }
      }
      if (moneyReq > 0D) {
        EconomyResponse er=VaultHelper.econ.withdrawPlayer(player,moneyReq);
        if (!er.transactionSuccess()) {
          plugin.getLogger().warning("String_Node_Str" + VaultHelper.econ.format(moneyReq) + "String_Node_Str"+ player.getName()+ "String_Node_Str"+ challenge);
          plugin.getLogger().warning("String_Node_Str" + VaultHelper.econ.format(VaultHelper.econ.getBalance(player)));
        }
      }
    }
    return true;
  }
  if (type.equalsIgnoreCase("String_Node_Str")) {
    final HashMap<Material,Integer> neededItem=new HashMap<Material,Integer>();
    final HashMap<EntityType,Integer> neededEntities=new HashMap<EntityType,Integer>();
    for (int i=0; i < reqList.length; i++) {
      final String[] sPart=reqList[i].split("String_Node_Str");
      try {
        final int qty=Integer.parseInt(sPart[1]);
        boolean isEntity=false;
        for (        EntityType entityType : EntityType.values()) {
          if (entityType.toString().equalsIgnoreCase(sPart[0])) {
            isEntity=true;
            break;
          }
        }
        if (isEntity) {
          EntityType entityType=EntityType.valueOf(sPart[0].toUpperCase());
          if (entityType != null) {
            neededEntities.put(entityType,qty);
          }
        }
 else {
          Material item;
          if (StringUtils.isNumeric(sPart[0])) {
            item=Material.getMaterial(Integer.parseInt(sPart[0]));
          }
 else {
            item=Material.getMaterial(sPart[0].toUpperCase());
          }
          if (item != null) {
            neededItem.put(item,qty);
          }
 else {
            plugin.getLogger().warning("String_Node_Str" + challenge + "String_Node_Str");
            return false;
          }
        }
      }
 catch (      Exception intEx) {
        plugin.getLogger().warning("String_Node_Str" + challenge + "String_Node_Str");
        return false;
      }
    }
    final Location l=player.getLocation();
    final int px=l.getBlockX();
    final int py=l.getBlockY();
    final int pz=l.getBlockZ();
    for (int x=-10; x <= 10; x++) {
      for (int y=-10; y <= 10; y++) {
        for (int z=-10; z <= 10; z++) {
          final Material b=new Location(l.getWorld(),px + x,py + y,pz + z).getBlock().getType();
          if (neededItem.containsKey(b)) {
            if (neededItem.get(b) == 1) {
              neededItem.remove(b);
            }
 else {
              neededItem.put(b,neededItem.get(b) - 1);
            }
          }
        }
      }
    }
    if (!neededItem.isEmpty()) {
      for (      Material missing : neededItem.keySet()) {
        player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).challengeserrorYouAreMissing + "String_Node_Str"+ neededItem.get(missing)+ "String_Node_Str"+ Util.prettifyText(missing.toString()));
      }
      return false;
    }
 else {
      for (      Entity entity : player.getNearbyEntities(10,10,10)) {
        if (neededEntities.containsKey(entity.getType())) {
          if (neededEntities.get(entity.getType()) == 1) {
            neededEntities.remove(entity.getType());
          }
 else {
            neededEntities.put(entity.getType(),neededEntities.get(entity.getType()) - 1);
          }
        }
 else {
        }
      }
      if (neededEntities.isEmpty()) {
        return true;
      }
 else {
        for (        EntityType missing : neededEntities.keySet()) {
          player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).challengeserrorYouAreMissing + "String_Node_Str"+ neededEntities.get(missing)+ "String_Node_Str"+ Util.prettifyText(missing.toString()));
        }
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Checks if a player has enough for a challenge. Supports two types of checks, inventory and island. Removes items if required.
 * @param player
 * @param challenge
 * @param type
 * @return true if the player has everything required
 */
@SuppressWarnings("String_Node_Str") public boolean hasRequired(final Player player,final String challenge,final String type){
  double moneyReq=0D;
  if (Settings.useEconomy) {
    moneyReq=getChallengeConfig().getDouble("String_Node_Str" + challenge + "String_Node_Str",0D);
    if (moneyReq > 0D) {
      if (!VaultHelper.econ.has(player,Settings.worldName,moneyReq)) {
        player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).challengeserrorNotEnoughItems);
        player.sendMessage(ChatColor.RED + getChallengeConfig().getString("String_Node_Str" + challenge + "String_Node_Str"));
        return false;
      }
    }
  }
  final String[] reqList=getChallengeConfig().getString("String_Node_Str" + challenge + "String_Node_Str").split("String_Node_Str");
  if (type.equalsIgnoreCase("String_Node_Str")) {
    List<ItemStack> toBeRemoved=new ArrayList<ItemStack>();
    Material reqItem;
    int reqAmount=0;
    for (    final String s : reqList) {
      final String[] part=s.split("String_Node_Str");
      if (part.length == 2) {
        try {
          if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
          if (StringUtils.isNumeric(part[0])) {
            reqItem=Material.getMaterial(Integer.parseInt(part[0]));
          }
 else {
            reqItem=Material.getMaterial(part[0].toUpperCase());
          }
          reqAmount=Integer.parseInt(part[1]);
          ItemStack item=new ItemStack(reqItem);
          if (!player.getInventory().contains(reqItem)) {
            return false;
          }
 else {
            int amount=0;
            for (            Entry<Integer,? extends ItemStack> en : player.getInventory().all(reqItem).entrySet()) {
              ItemStack i=en.getValue();
              if (i.getDurability() == 0 || (reqItem == Material.MAP && i.getType() == Material.MAP)) {
                i.setItemMeta(null);
                player.getInventory().setItem(en.getKey(),i);
                if ((amount + i.getAmount()) < reqAmount) {
                  toBeRemoved.add(i.clone());
                  amount+=i.getAmount();
                }
 else                 if ((amount + i.getAmount()) == reqAmount) {
                  toBeRemoved.add(i.clone());
                  amount+=i.getAmount();
                  break;
                }
 else {
                  item.setAmount(reqAmount - amount);
                  item.setDurability(i.getDurability());
                  toBeRemoved.add(item);
                  amount+=i.getAmount();
                  break;
                }
              }
            }
            if (amount < reqAmount) {
              return false;
            }
          }
        }
 catch (        Exception e) {
          plugin.getLogger().severe("String_Node_Str" + s + "String_Node_Str");
          player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorCommandNotReady);
          String materialList="String_Node_Str";
          boolean hint=false;
          for (          Material m : Material.values()) {
            materialList+=m.toString() + "String_Node_Str";
            if (m.toString().contains(s.substring(0,3).toUpperCase())) {
              plugin.getLogger().severe("String_Node_Str" + m.toString() + "String_Node_Str");
              hint=true;
            }
          }
          if (!hint) {
            plugin.getLogger().severe("String_Node_Str" + s + "String_Node_Str");
            plugin.getLogger().severe(materialList.substring(0,materialList.length() - 1));
          }
 else {
            plugin.getLogger().severe("String_Node_Str");
          }
          return false;
        }
      }
 else       if (part.length == 3) {
        try {
          if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
 else           if (part[0].equalsIgnoreCase("String_Node_Str")) {
            part[0]="String_Node_Str";
          }
          if (StringUtils.isNumeric(part[0])) {
            reqItem=Material.getMaterial(Integer.parseInt(part[0]));
          }
 else {
            reqItem=Material.getMaterial(part[0].toUpperCase());
          }
          reqAmount=Integer.parseInt(part[2]);
          int reqDurability=Integer.parseInt(part[1]);
          int count=reqAmount;
          ItemStack item=new ItemStack(reqItem);
          if (reqItem.equals(Material.POTION)) {
            ItemStack[] playerInv=player.getInventory().getContents();
            for (            ItemStack i : playerInv) {
              if (i != null && i.getType().equals(Material.POTION)) {
                if (i.getDurability() == reqDurability) {
                  item=i.clone();
                  if (item.getAmount() > reqAmount) {
                    item.setAmount(reqAmount);
                  }
                  count=count - item.getAmount();
                  toBeRemoved.add(item);
                }
              }
              if (count == 0) {
                break;
              }
            }
            if (count > 0) {
              return false;
            }
          }
 else {
            item.setDurability((short)reqDurability);
            int amount=0;
            for (            Entry<Integer,? extends ItemStack> en : player.getInventory().all(reqItem).entrySet()) {
              ItemStack i=en.getValue();
              if (i.getDurability() == reqDurability) {
                i.setItemMeta(null);
                player.getInventory().setItem(en.getKey(),i);
                if ((amount + i.getAmount()) < reqAmount) {
                  toBeRemoved.add(i.clone());
                  amount+=i.getAmount();
                }
 else                 if ((amount + i.getAmount()) == reqAmount) {
                  toBeRemoved.add(i.clone());
                  amount+=i.getAmount();
                  break;
                }
 else {
                  item.setAmount(reqAmount - amount);
                  item.setDurability(i.getDurability());
                  toBeRemoved.add(item);
                  amount+=i.getAmount();
                  break;
                }
              }
            }
            if (amount < reqAmount) {
              return false;
            }
          }
        }
 catch (        Exception e) {
          plugin.getLogger().severe("String_Node_Str" + s + "String_Node_Str");
          player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorCommandNotReady);
          if (part[0].equalsIgnoreCase("String_Node_Str")) {
            plugin.getLogger().severe("String_Node_Str");
            for (            PotionType p : PotionType.values()) {
              plugin.getLogger().info(p.toString() + "String_Node_Str" + p.getDamageValue());
            }
          }
 else {
            String materialList="String_Node_Str";
            boolean hint=false;
            for (            Material m : Material.values()) {
              materialList+=m.toString() + "String_Node_Str";
              if (m.toString().contains(s.substring(0,3))) {
                plugin.getLogger().severe("String_Node_Str" + m.toString() + "String_Node_Str");
                hint=true;
              }
            }
            if (!hint) {
              plugin.getLogger().severe("String_Node_Str" + s + "String_Node_Str");
              plugin.getLogger().severe(materialList.substring(0,materialList.length() - 1));
            }
 else {
              plugin.getLogger().severe("String_Node_Str");
            }
            return false;
          }
          return false;
        }
      }
 else       if (part.length == 6) {
        try {
          if (StringUtils.isNumeric(part[0])) {
            reqItem=Material.getMaterial(Integer.parseInt(part[0]));
          }
 else {
            reqItem=Material.getMaterial(part[0].toUpperCase());
          }
          reqAmount=Integer.parseInt(part[5]);
          ItemStack item=new ItemStack(reqItem);
          int count=reqAmount;
          if (reqItem == Material.POTION) {
            ItemStack[] playerInv=player.getInventory().getContents();
            for (            ItemStack i : playerInv) {
              if (i != null && i.getType().equals(Material.POTION)) {
                Potion p=fromDamage(i.getDurability());
                PotionType typeCheck=PotionType.valueOf(part[1].toUpperCase());
                if (p.getType().equals(typeCheck)) {
                  if (part[2].isEmpty() || p.getLevel() == Integer.valueOf(part[2])) {
                    if (part[4].isEmpty() || (p.isSplash() && part[4].equalsIgnoreCase("String_Node_Str")) || (!p.isSplash() && part[4].equalsIgnoreCase("String_Node_Str"))) {
                      if (part[3].isEmpty() || (p.hasExtendedDuration() && part[3].equalsIgnoreCase("String_Node_Str")) || (!p.hasExtendedDuration() && part[3].equalsIgnoreCase("String_Node_Str"))) {
                        item=i.clone();
                        if (item.getAmount() > reqAmount) {
                          item.setAmount(reqAmount);
                        }
                        count=count - item.getAmount();
                        toBeRemoved.add(item);
                      }
                    }
                  }
                }
              }
              if (count <= 0) {
                break;
              }
            }
            if (count > 0) {
              return false;
            }
          }
 else {
            plugin.getLogger().severe("String_Node_Str" + s + "String_Node_Str");
          }
        }
 catch (        Exception e) {
          plugin.getLogger().severe("String_Node_Str" + s + "String_Node_Str");
          player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorCommandNotReady);
          if (part[0].equalsIgnoreCase("String_Node_Str")) {
            plugin.getLogger().severe("String_Node_Str");
            plugin.getLogger().severe("String_Node_Str");
            plugin.getLogger().severe("String_Node_Str");
            plugin.getLogger().severe("String_Node_Str");
            plugin.getLogger().severe("String_Node_Str");
            plugin.getLogger().severe("String_Node_Str");
            plugin.getLogger().severe("String_Node_Str");
            plugin.getLogger().severe("String_Node_Str");
            String potionNames="String_Node_Str";
            for (            PotionType p : PotionType.values()) {
              potionNames+=p.toString() + "String_Node_Str";
            }
            plugin.getLogger().severe(potionNames.substring(0,potionNames.length() - 2));
          }
          return false;
        }
      }
    }
    if (getChallengeConfig().getBoolean("String_Node_Str" + challenge + "String_Node_Str")) {
      for (      ItemStack i : toBeRemoved) {
        HashMap<Integer,ItemStack> leftOver=player.getInventory().removeItem(i);
        if (!leftOver.isEmpty()) {
          plugin.getLogger().warning("String_Node_Str" + challenge + "String_Node_Str"+ player.getName()+ "String_Node_Str");
          for (          ItemStack left : leftOver.values()) {
            plugin.getLogger().info(left.toString());
          }
          return false;
        }
      }
      if (moneyReq > 0D) {
        EconomyResponse er=VaultHelper.econ.withdrawPlayer(player,moneyReq);
        if (!er.transactionSuccess()) {
          plugin.getLogger().warning("String_Node_Str" + VaultHelper.econ.format(moneyReq) + "String_Node_Str"+ player.getName()+ "String_Node_Str"+ challenge);
          plugin.getLogger().warning("String_Node_Str" + VaultHelper.econ.format(VaultHelper.econ.getBalance(player)));
        }
      }
    }
    return true;
  }
  if (type.equalsIgnoreCase("String_Node_Str")) {
    final HashMap<Material,Integer> neededItem=new HashMap<Material,Integer>();
    final HashMap<EntityType,Integer> neededEntities=new HashMap<EntityType,Integer>();
    for (int i=0; i < reqList.length; i++) {
      final String[] sPart=reqList[i].split("String_Node_Str");
      try {
        final int qty=Integer.parseInt(sPart[1]);
        boolean isEntity=false;
        for (        EntityType entityType : EntityType.values()) {
          if (entityType.toString().equalsIgnoreCase(sPart[0])) {
            isEntity=true;
            break;
          }
        }
        if (isEntity) {
          EntityType entityType=EntityType.valueOf(sPart[0].toUpperCase());
          if (entityType != null) {
            neededEntities.put(entityType,qty);
          }
        }
 else {
          Material item;
          if (StringUtils.isNumeric(sPart[0])) {
            item=Material.getMaterial(Integer.parseInt(sPart[0]));
          }
 else {
            item=Material.getMaterial(sPart[0].toUpperCase());
          }
          if (item != null) {
            neededItem.put(item,qty);
          }
 else {
            plugin.getLogger().warning("String_Node_Str" + challenge + "String_Node_Str");
            return false;
          }
        }
      }
 catch (      Exception intEx) {
        plugin.getLogger().warning("String_Node_Str" + challenge + "String_Node_Str");
        return false;
      }
    }
    final Location l=player.getLocation();
    final int px=l.getBlockX();
    final int py=l.getBlockY();
    final int pz=l.getBlockZ();
    for (int x=-10; x <= 10; x++) {
      for (int y=-10; y <= 10; y++) {
        for (int z=-10; z <= 10; z++) {
          final Material b=new Location(l.getWorld(),px + x,py + y,pz + z).getBlock().getType();
          if (neededItem.containsKey(b)) {
            if (neededItem.get(b) == 1) {
              neededItem.remove(b);
            }
 else {
              neededItem.put(b,neededItem.get(b) - 1);
            }
          }
        }
      }
    }
    if (!neededItem.isEmpty()) {
      for (      Material missing : neededItem.keySet()) {
        player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).challengeserrorYouAreMissing + "String_Node_Str"+ neededItem.get(missing)+ "String_Node_Str"+ Util.prettifyText(missing.toString()));
      }
      return false;
    }
 else {
      for (      Entity entity : player.getNearbyEntities(10,10,10)) {
        if (neededEntities.containsKey(entity.getType())) {
          if (neededEntities.get(entity.getType()) == 1) {
            neededEntities.remove(entity.getType());
          }
 else {
            neededEntities.put(entity.getType(),neededEntities.get(entity.getType()) - 1);
          }
        }
 else {
        }
      }
      if (neededEntities.isEmpty()) {
        return true;
      }
 else {
        for (        EntityType missing : neededEntities.keySet()) {
          player.sendMessage(ChatColor.RED + plugin.myLocale(player.getUniqueId()).challengeserrorYouAreMissing + "String_Node_Str"+ neededEntities.get(missing)+ "String_Node_Str"+ Util.prettifyText(missing.toString()));
        }
        return false;
      }
    }
  }
  return true;
}