Skip to content

Commit

Permalink
made pipes not connect if using different colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Aug 25, 2024
1 parent d3016ab commit fa72ffc
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,20 @@ public void clearConnection(Direction side) {
}
}

public void checkConnections(){
for (Direction side : Direction.values()) {
BlockEntityPipe<?> pipe = getPipe(side);
if (pipe != null) {
if (pipe.pipeColor != -1 && this.pipeColor != -1){
if (pipe.pipeColor != this.pipeColor) {
clearConnection(side);
pipe.clearConnection(side.getOpposite());
}
}
}
}
}

public boolean canConnect(int side) {
return Connectivity.has(connection, side);
}
Expand Down Expand Up @@ -366,6 +380,8 @@ public ICover getCover(Direction side) {
}

public boolean blocksSide(Direction side) {
BlockEntityPipe<?> neighbor = getPipe(side);
if (neighbor != null && this.pipeColor != -1 && neighbor.pipeColor != -1 && neighbor.getPipeColor() != this.getPipeColor()) return true;
return coverHandler.map(t -> t.blocksCapability(getCapClass(), side) || t.get(side).blockConnection(side)).orElse(false);
}

Expand Down

0 comments on commit fa72ffc

Please sign in to comment.