diff --git a/Common/src/main/java/at/petrak/hexcasting/api/casting/iota/PatternIota.java b/Common/src/main/java/at/petrak/hexcasting/api/casting/iota/PatternIota.java index 74db0a95f..097fae52a 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/casting/iota/PatternIota.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/casting/iota/PatternIota.java @@ -71,7 +71,7 @@ public boolean toleratesOther(Iota that) { public @NotNull CastResult execute(CastingVM vm, ServerLevel world, SpellContinuation continuation) { Supplier<@Nullable Component> castedName = () -> null; try { - var lookup = PatternRegistryManifest.matchPattern(this.getPattern(), vm.getEnv(), false); + var lookup = PatternRegistryManifest.matchPattern(this.getPattern(), vm.getEnv()); vm.getEnv().precheckAction(lookup); Action action; diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/PatternRegistryManifest.java b/Common/src/main/java/at/petrak/hexcasting/common/casting/PatternRegistryManifest.java index 5d15f8fe4..789721398 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/PatternRegistryManifest.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/PatternRegistryManifest.java @@ -86,10 +86,9 @@ public static Pair>> match * Try to match this pattern to an action, whether via a normal pattern, a per-world pattern, or the machinations * of a special handler. * - * @param checkForAlternateStrokeOrders if this is true, will check if the pattern given is an erroneous stroke - * order - * for a per-world pattern. + * @deprecated Giving this method a true will cause it to throw if it cannot find a normal or per-world pattern match. Use the bool-less overload instead. */ + @Deprecated(since = "0.11.4") public static PatternShapeMatch matchPattern(HexPattern pat, CastingEnvironment environment, boolean checkForAlternateStrokeOrders) { // I am PURPOSELY checking normal actions before special handlers @@ -119,6 +118,14 @@ public static PatternShapeMatch matchPattern(HexPattern pat, CastingEnvironment return new PatternShapeMatch.Nothing(); } + /** + * Try to match this pattern to an action, whether via a normal pattern, a per-world pattern, or the machinations + * of a special handler. Will never attempt to check alternate stroke orders, which always throws. + */ + public static PatternShapeMatch matchPattern(HexPattern pattern, CastingEnvironment environment){ + return matchPattern(pattern, environment, false); + } + @Nullable public static HexPattern getCanonicalStrokesPerWorld(ResourceKey key, ServerLevel overworld) { var perWorldPatterns = ScrungledPatternsSave.open(overworld); diff --git a/Common/src/main/java/at/petrak/hexcasting/interop/inline/InlinePatternData.java b/Common/src/main/java/at/petrak/hexcasting/interop/inline/InlinePatternData.java index 5dc2dba2f..e19bb2157 100644 --- a/Common/src/main/java/at/petrak/hexcasting/interop/inline/InlinePatternData.java +++ b/Common/src/main/java/at/petrak/hexcasting/interop/inline/InlinePatternData.java @@ -50,7 +50,7 @@ public Style getExtraStyle() { public static Component getPatternName(HexPattern pattern){ try { - PatternShapeMatch shapeMatch = PatternRegistryManifest.matchPattern(pattern, null, false); + PatternShapeMatch shapeMatch = PatternRegistryManifest.matchPattern(pattern, null); if(shapeMatch instanceof PatternShapeMatch.Normal normMatch){ return HexAPI.instance().getActionI18n(normMatch.key, false); }