Merge branch 'master' of https://github.com/KayyAyeAre/Mindustry
This commit is contained in:
@@ -859,6 +859,10 @@ public class Block extends UnlockableContent implements Senseable{
|
|||||||
return isVisible() && (!state.rules.bannedBlocks.contains(this) || state.rules.editor) && supportsEnv(state.rules.env);
|
return isVisible() && (!state.rules.bannedBlocks.contains(this) || state.rules.editor) && supportsEnv(state.rules.env);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean shouldConnect(Building build){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/** @return whether this block supports a specific environment. */
|
/** @return whether this block supports a specific environment. */
|
||||||
public boolean supportsEnv(int env){
|
public boolean supportsEnv(int env){
|
||||||
return (envEnabled & env) != 0 && (envDisabled & env) == 0 && (envRequired == 0 || (envRequired & env) == envRequired);
|
return (envEnabled & env) != 0 && (envDisabled & env) == 0 && (envRequired == 0 || (envRequired & env) == envRequired);
|
||||||
|
|||||||
@@ -215,6 +215,7 @@ public class PowerNode extends PowerBlock{
|
|||||||
overlaps(tile.x * tilesize + offset, tile.y * tilesize + offset, other.tile(), laserRange * tilesize) && other.team == team &&
|
overlaps(tile.x * tilesize + offset, tile.y * tilesize + offset, other.tile(), laserRange * tilesize) && other.team == team &&
|
||||||
!graphs.contains(other.power.graph) &&
|
!graphs.contains(other.power.graph) &&
|
||||||
!PowerNode.insulated(tile, other.tile) &&
|
!PowerNode.insulated(tile, other.tile) &&
|
||||||
|
other.block.shouldConnect(other) &&
|
||||||
!(other instanceof PowerNodeBuild obuild && obuild.power.links.size >= ((PowerNode)obuild.block).maxNodes) &&
|
!(other instanceof PowerNodeBuild obuild && obuild.power.links.size >= ((PowerNode)obuild.block).maxNodes) &&
|
||||||
!Structs.contains(Edges.getEdges(size), p -> { //do not link to adjacent buildings
|
!Structs.contains(Edges.getEdges(size), p -> { //do not link to adjacent buildings
|
||||||
var t = world.tile(tile.x + p.x, tile.y + p.y);
|
var t = world.tile(tile.x + p.x, tile.y + p.y);
|
||||||
|
|||||||
Reference in New Issue
Block a user