fix crash caused by placing piles immediately adjacent to RBMKs

This commit is contained in:
George Paton 2025-02-26 16:33:04 +11:00
parent bb84ebe209
commit a6b1a9068b
2 changed files with 3 additions and 3 deletions

View File

@ -65,7 +65,7 @@ public class PileNeutronHandler {
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);

View File

@ -222,7 +222,7 @@ public class RBMKNeutronHandler {
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);
@ -292,7 +292,7 @@ public class RBMKNeutronHandler {
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