Skip to content

Commit

Permalink
fix crash caused by placing piles immediately adjacent to RBMKs
Browse files Browse the repository at this point in the history
  • Loading branch information
MellowArpeggiation committed Feb 26, 2025
1 parent bb84ebe commit a6b1a90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void runStreamInteraction(World worldObj) {
TileEntity tile;

NeutronNode node = NeutronNodeWorld.getNode(worldObj, nodePos);
if(node != null) {
if(node != null && node instanceof PileNeutronNode) {
tile = node.tile;
} else {
tile = blockPosToTE(worldObj, nodePos);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/hbm/handler/neutron/RBMKNeutronHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public NeutronNode[] getNodes(boolean addNode) {
pos.mutate(origin.tile.xCoord + x, origin.tile.yCoord, origin.tile.zCoord + z);

NeutronNode node = NeutronNodeWorld.getNode(world, pos);
if(node != null) {
if(node != null && node instanceof RBMKNeutronNode) {
positions[i - 1] = node;
} else if(this.origin.tile.getBlockType() instanceof RBMKBase) {
TileEntity te = blockPosToTE(world, pos);
Expand Down Expand Up @@ -292,7 +292,7 @@ else if(hits > 0) { // If stream is partially blocked.

RBMKType type = (RBMKType) targetNode.data.get("type");

if(type == RBMKType.OTHER) // pass right on by!
if(type == RBMKType.OTHER || type == null) // pass right on by!
continue;

// we established earlier during `getNodes()` that they should all be RBMKBase TEs
Expand Down

0 comments on commit a6b1a90

Please sign in to comment.