Skip to content

Commit

Permalink
Add Overload to where() in FactoryBlockPattern (GregTechCEu#2538)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghzdude authored Jul 14, 2024
1 parent b6eec3c commit e8259d5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/gregtech/api/pattern/FactoryBlockPattern.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ public FactoryBlockPattern where(char symbol, TraceabilityPredicate blockMatcher
return this;
}

public FactoryBlockPattern where(String symbol, TraceabilityPredicate blockMatcher) {
if (symbol.length() == 1) {
return where(symbol.charAt(0), blockMatcher);
}
throw new IllegalArgumentException(
String.format("Symbol \"%s\" is invalid! It must be exactly one character!", symbol));
}

public BlockPattern build() {
return new BlockPattern(makePredicateArray(), structureDir,
aisleRepetitions.toArray(new int[aisleRepetitions.size()][]));
Expand Down

0 comments on commit e8259d5

Please sign in to comment.