Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
made pipeline ends require at least 1 pipeline block between them
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Aug 21, 2023
1 parent 70652b6 commit 645d32a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ public boolean checkStructure() {
Direction to = this.getFacing().getOpposite();
BlockPos.MutableBlockPos mut = this.getBlockPos().mutable();
successfulPositions = new LongArrayList();
int pipelinesFound = 0;
while (true){
mut.move(to);
BlockState state = this.getLevel().getBlockState(mut);
Expand All @@ -197,6 +198,7 @@ public boolean checkStructure() {
}
if (state.getBlock() == getPipeline()){
successfulPositions.add(mut.asLong());
pipelinesFound++;
continue;
}
mut.move(to.getOpposite());
Expand All @@ -217,7 +219,7 @@ public boolean checkStructure() {
}
}
checkingStructure--;
validStructure = succeed;
validStructure = succeed && pipelinesFound > 0;
if (validStructure){
if (level instanceof TrackedDummyWorld) {
StructureCache.add(level, worldPosition, successfulPositions);
Expand Down

0 comments on commit 645d32a

Please sign in to comment.