From e2d64ff37628bc70a08052e2d78bd1781ccbad70 Mon Sep 17 00:00:00 2001 From: BallOfEnergy <66693744+ballofenergy1@users.noreply.github.com> Date: Sun, 9 Feb 2025 18:00:52 -0600 Subject: [PATCH] Fix for main issue #1933. --- .../hbm/handler/neutron/RBMKNeutronHandler.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hbm/handler/neutron/RBMKNeutronHandler.java b/src/main/java/com/hbm/handler/neutron/RBMKNeutronHandler.java index d3f883589..3b78af0e1 100644 --- a/src/main/java/com/hbm/handler/neutron/RBMKNeutronHandler.java +++ b/src/main/java/com/hbm/handler/neutron/RBMKNeutronHandler.java @@ -378,7 +378,19 @@ public class RBMKNeutronHandler { TileEntityRBMKControl rod = (TileEntityRBMKControl) lastNode.tile; if (rod.getMult() > 0.0D) { this.fluxQuantity *= rod.getMult(); - irradiateFromFlux(new BlockPos(lastNode.tile.xCoord + this.vector.xCoord, lastNode.tile.yCoord, lastNode.tile.zCoord + this.vector.zCoord)); + BlockPos posAfter = new BlockPos(lastNode.tile.xCoord + this.vector.xCoord, lastNode.tile.yCoord, lastNode.tile.zCoord + this.vector.zCoord); + + // The below code checks if the block after the control rod is actually a block or if it's an RBMK rod. + // Resolves GitHub issue #1933. + if(!NeutronNodeWorld.nodeCache.containsKey(posAfter)) { + TileEntity te = blockPosToTE(worldObj, posAfter); + if (te instanceof TileEntityRBMKBase) { + RBMKNeutronNode node = makeNode((TileEntityRBMKBase) te); + NeutronNodeWorld.addNode(node); + } else { + irradiateFromFlux(posAfter); // I'm so mad about this... + } + } } } } @@ -390,7 +402,7 @@ public class RBMKNeutronHandler { // holy fucking shit // I have had this one line cause me like tens of problems // I FUCKING HATE THIS - // total count of bugs fixed attributed to this function: 13 + // total count of bugs fixed attributed to this function: 14 Block block = origin.tile.getWorldObj().getBlock(pos.getX(), pos.getY() + h, pos.getZ()); if (block.isOpaqueCube()) hits += 1;