コード例 #1
0
ファイル: PipeLogicWood.java プロジェクト: Zenexer/BuildCraft
  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;
  }
コード例 #2
0
ファイル: Util.java プロジェクト: GodlikeGuy/Yiffcraft
 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!");
 }