From e8259d58d0fd0390d04107edec645bd035fcece5 Mon Sep 17 00:00:00 2001 From: Ghzdude <44148655+ghzdude@users.noreply.github.com> Date: Sun, 14 Jul 2024 14:42:27 -0700 Subject: [PATCH] Add Overload to `where()` in FactoryBlockPattern (#2538) --- .../java/gregtech/api/pattern/FactoryBlockPattern.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/gregtech/api/pattern/FactoryBlockPattern.java b/src/main/java/gregtech/api/pattern/FactoryBlockPattern.java index e83c519186d..fa44ba6cdcc 100644 --- a/src/main/java/gregtech/api/pattern/FactoryBlockPattern.java +++ b/src/main/java/gregtech/api/pattern/FactoryBlockPattern.java @@ -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()][]));