public void CheckForCompletedMachine(ModCheckForCompletedMachineParameters parameters) { MachineRegistration machineRegistration = null; FCEMultiblockMachineAttribute specs = machineRegistration.MultiblockAttributes; if (!machineByPlacement.TryGetValue(parameters.CubeValue, out machineRegistration)) { return; } // Find the negative-most corner long x = parameters.X; long y = parameters.Y; long z = parameters.Z; long minY = parameters.Y, minX = parameters.X, minZ = parameters.Z; while (IsPlacement(parameters.Frustrum, minX - 1, minY, minZ, machineRegistration.PlacementBlock)) { minX--; } while (IsPlacement(parameters.Frustrum, minX, minY - 1, minZ, machineRegistration.PlacementBlock)) { minY--; } while (IsPlacement(parameters.Frustrum, minX, minY, minZ - 1, machineRegistration.PlacementBlock)) { minZ--; } long maxY = minY + specs.Length, maxX = 0, maxZ = 0; if (IsPlacement(parameters.Frustrum, minX + specs.Length, maxY, maxZ + specs.Width, machineRegistration.PlacementBlock)) { maxX = minX + specs.Length; maxZ = minZ + specs.Width; } else if (IsPlacement(parameters.Frustrum, minX + specs.Width, maxY, maxZ + specs.Length, machineRegistration.PlacementBlock)) { maxX = minX + specs.Width; maxZ = minZ + specs.Length; } else { // Couldn't find opposite corner, so just throw it out return; } }
public BoxMachineBoundsChecker(FCEMultiblockMachineAttribute spec) { }