diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 767d4be608..e0a753530c 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -1254,7 +1254,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, public void placed(){ if(net.client()) return; - if((block.consumesPower || block.outputsPower) && block.hasPower){ + if((block.consumesPower || block.outputsPower) && block.hasPower && block.connectedPower){ PowerNode.getNodeLinks(tile, block, team, other -> { if(!other.power.links.contains(pos())){ other.configureAny(pos()); diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index e96c58bbb9..ef0ac3ef48 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -51,6 +51,8 @@ public class Block extends UnlockableContent implements Senseable{ public boolean consumesPower = true; /** If true, this block is a generator that can produce power. */ public boolean outputsPower = false; + /** If false, power nodes cannot connect to this block. */ + public boolean connectedPower = true; /** If true, this block can conduct power like a cable. */ public boolean conductivePower = false; /** If true, this block can output payloads; affects blending. */ @@ -413,7 +415,7 @@ public class Block extends UnlockableContent implements Senseable{ } public void drawPotentialLinks(int x, int y){ - if((consumesPower || outputsPower) && hasPower){ + if((consumesPower || outputsPower) && hasPower && connectedPower){ Tile tile = world.tile(x, y); if(tile != null){ PowerNode.getNodeLinks(tile, this, player.team(), other -> { diff --git a/core/src/mindustry/world/blocks/power/BeamNode.java b/core/src/mindustry/world/blocks/power/BeamNode.java index 4ed735e9e8..e34449d791 100644 --- a/core/src/mindustry/world/blocks/power/BeamNode.java +++ b/core/src/mindustry/world/blocks/power/BeamNode.java @@ -179,7 +179,7 @@ public class BeamNode extends PowerBlock{ } //power nodes do NOT play nice with beam nodes, do not touch them as that forcefully modifies their links - if(other != null && other.block.hasPower && other.team == team && !(other.block instanceof PowerNode)){ + if(other != null && other.block.hasPower && other.block.connectedPower && other.team == team && !(other.block instanceof PowerNode)){ links[i] = other; dests[i] = world.tile(tile.x + j * dir.x, tile.y + j * dir.y); break; diff --git a/core/src/mindustry/world/blocks/power/PowerNode.java b/core/src/mindustry/world/blocks/power/PowerNode.java index 47476a2e95..c543a58b03 100644 --- a/core/src/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/mindustry/world/blocks/power/PowerNode.java @@ -210,7 +210,7 @@ public class PowerNode extends PowerBlock{ protected void getPotentialLinks(Tile tile, Team team, Cons others){ if(!autolink) return; - Boolf valid = other -> other != null && other.tile() != tile && other.power != null && + Boolf valid = other -> other != null && other.tile() != tile && other.block.connectedPower && other.power != null && (other.block.outputsPower || other.block.consumesPower || other.block instanceof PowerNode) && overlaps(tile.x * tilesize + offset, tile.y * tilesize + offset, other.tile(), laserRange * tilesize) && other.team == team && !graphs.contains(other.power.graph) && @@ -342,7 +342,7 @@ public class PowerNode extends PowerBlock{ } public boolean linkValid(Building tile, Building link, boolean checkMaxNodes){ - if(tile == link || link == null || !link.block.hasPower || tile.team != link.team) return false; + if(tile == link || link == null || !link.block.hasPower || !link.block.connectedPower || tile.team != link.team) return false; if(overlaps(tile, link, laserRange * tilesize) || (link.block instanceof PowerNode node && overlaps(link, tile, node.laserRange * tilesize))){ if(checkMaxNodes && link.block instanceof PowerNode node){