private void projectBlueprint() { int facing = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); ForgeDirection direction = MinechemHelper.getDirectionFromFacing(facing); LocalPosition position = new LocalPosition(xCoord, yCoord, zCoord, direction); position.moveForwards(blueprint.zSize + 1); position.moveLeft(Math.floor(blueprint.xSize / 2)); boolean shouldProjectGhostBlocks = true; int totalIncorrectCount = blueprint.getTotalSize(); for (int x = 0; x < blueprint.xSize; x++) { int verticalIncorrectCount = blueprint.getVerticalSliceSize(); for (int y = 0; y < blueprint.ySize; y++) { for (int z = 0; z < blueprint.zSize; z++) { if (shouldProjectGhostBlocks) { BlockStatus blockStatus; if (isManagerBlock(x, y, z)) blockStatus = BlockStatus.CORRECT; else blockStatus = projectGhostBlock(x, y, z, position); if (blockStatus == BlockStatus.CORRECT) { verticalIncorrectCount--; totalIncorrectCount--; } } else { destroyGhostBlock(x, y, z, position); } } } if (verticalIncorrectCount != 0) shouldProjectGhostBlocks = false; } if (totalIncorrectCount == 0 && !isComplete) { isComplete = true; buildStructure(position); } }