diff --git a/src/main/java/gregtech/api/nuclear/fission/FissionReactor.java b/src/main/java/gregtech/api/nuclear/fission/FissionReactor.java index 23692a50d3d..79b33079028 100644 --- a/src/main/java/gregtech/api/nuclear/fission/FissionReactor.java +++ b/src/main/java/gregtech/api/nuclear/fission/FissionReactor.java @@ -243,19 +243,18 @@ public void computeGeometry() { * Geometric factor calculation is done by (rough) numerical integration along a straight path between * the two cells */ + int prevX = fuelRods.get(i).getX(); + int prevY = fuelRods.get(i).getY(); double resolution = ConfigHolder.machines.nuclear.fissionReactorResolution; for (int t = 0; t < resolution; t++) { - double x; - double y; - - x = (rodTwo.getX() - rodOne.getX()) * - ((float) t / resolution) + fuelRods.get(i).getX(); - y = (rodTwo.getY() - rodOne.getY()) * - ((float) t / resolution) + fuelRods.get(i).getY(); + int x = (int) Math.round((rodTwo.getX() - rodOne.getX()) * + ((float) t / resolution) + fuelRods.get(i).getX()); + int y = (int) Math.round((rodTwo.getY() - rodOne.getY()) * + ((float) t / resolution) + fuelRods.get(i).getY()); if (x < 0 || x > reactorLayout.length - 1 || y < 0 || y > reactorLayout.length - 1) { continue; } - ReactorComponent component = reactorLayout[(int) Math.round(x)][(int) Math.round(y)]; + ReactorComponent component = reactorLayout[x][y]; if (component == null) { continue; @@ -263,6 +262,12 @@ public void computeGeometry() { mij += component.getModerationFactor(); + if (x == prevX && y == prevY) { + continue; + } + prevX = x; + prevY = y; + /* * For simplicity, we pretend that fuel rods are completely opaque to neutrons, paths that hit fuel * rods are ignored as obstructed diff --git a/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java b/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java index 72d6494aff3..c8509db454b 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java +++ b/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java @@ -325,11 +325,12 @@ protected EnumFacing getRight() { /** * Uses the upper layer to determine the diameter of the structure */ - protected int findDiameter() { + protected int findDiameter(int heightTop) { int i = 1; BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(this.getPos()); + pos.move(getUp(), heightTop); while (i <= 15) { - if (this.isBlockEdge(this.getWorld(), pos.move(getUp()), + if (this.isBlockEdge(this.getWorld(), pos, this.getFrontFacing().getOpposite(), i)) break; @@ -482,7 +483,7 @@ protected BlockPattern createStructurePattern() { this.height = heightTop + heightBottom + 1; - this.diameter = this.getWorld() != null ? Math.max(Math.min(this.findDiameter(), 15), 5) : 5; + this.diameter = this.getWorld() != null ? Math.max(Math.min(this.findDiameter(heightTop), 15), 5) : 5; int radius = this.diameter % 2 == 0 ? (int) Math.floor(this.diameter / 2.f) : Math.round((this.diameter - 1) / 2.f); diff --git a/src/main/resources/assets/gregtech/lang/en_us.lang b/src/main/resources/assets/gregtech/lang/en_us.lang index b4320c5ceea..8d5152733c7 100644 --- a/src/main/resources/assets/gregtech/lang/en_us.lang +++ b/src/main/resources/assets/gregtech/lang/en_us.lang @@ -1616,8 +1616,9 @@ gregtech.material.palladium=Palladium gregtech.material.phosphorus=Phosphorus gregtech.material.polonium=Polonium gregtech.material.platinum=Platinum +gregtech.material.plutonium=Plutonium gregtech.material.plutonium_238=Plutonium 238 -gregtech.material.plutonium=Plutonium 239 +gregtech.material.plutonium_239=Plutonium 239 gregtech.material.plutonium_240=Plutonium 240 gregtech.material.plutonium_241=Plutonium 241 gregtech.material.plutonium_242=Plutonium 242