public void setBlueprint(MinechemBlueprint blueprint) {
   if (blueprint != null) {
     this.blueprint = blueprint;
     this.structure = blueprint.getStructure();
   } else {
     destroyProjection();
     this.blueprint = null;
     this.structure = null;
     this.isComplete = false;
   }
 }
示例#2
0
  private HashMap<Integer, Integer> getBlockCount(MinechemBlueprint blueprint) {
    HashMap<Integer, Integer> blockCount = new HashMap<Integer, Integer>();

    for (int x = 0; x < blueprint.xSize; x++) {
      for (int y = 0; y < blueprint.ySize; y++) {
        for (int z = 0; z < blueprint.zSize; z++) {
          int structureID = blueprint.getStructure()[y][x][z];
          int count = 0;
          if (blockCount.get(structureID) != null) count = (int) blockCount.get(structureID);
          count++;
          blockCount.put(structureID, count);
        }
      }
    }

    return blockCount;
  }