public static boolean isExcludedFromExtraction(Block block) {
    if (block == null) return true;

    for (String excluded : excludedBlocks)
      if (excluded.equals(block.getBlockName()) || excluded.equals(Integer.toString(block.blockID)))
        return true;

    return false;
  }
Exemple #2
0
 public static int GetBlockID(String str) throws Exception {
   try {
     int i = Integer.parseInt(str);
     if (i > 0) return i;
   } catch (Exception e) {
   }
   str = "tile." + str.replace('_', ' ').trim().toLowerCase();
   for (int j = 0; j < 256; j++) {
     Block b = Block.blocksList[j];
     if (b == null) continue;
     if (b.getBlockName().toLowerCase().equals(str)) return j;
   }
   throw new Exception("Block not found!");
 }