From 9769c25a1cde0df53419afb8245ca3335407aed5 Mon Sep 17 00:00:00 2001 From: rlnt Date: Tue, 22 Oct 2024 13:57:20 +0200 Subject: [PATCH] fix new custom tags entries not being considered in unification --- CHANGELOG.md | 1 + .../unified/core/AlmostUnifiedRuntimeImpl.java | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ce5394..14ddabb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning]. ## Unreleased - fixed crash when runtime isn't loaded ([#101](https://github.com/AlmostReliable/almostunified/issues/101)) +- fixed newly created custom tags not being considered for unification ## [1.2.0] - 2024-10-06 diff --git a/Common/src/main/java/com/almostreliable/unified/core/AlmostUnifiedRuntimeImpl.java b/Common/src/main/java/com/almostreliable/unified/core/AlmostUnifiedRuntimeImpl.java index 16bb2a5..d9c73eb 100644 --- a/Common/src/main/java/com/almostreliable/unified/core/AlmostUnifiedRuntimeImpl.java +++ b/Common/src/main/java/com/almostreliable/unified/core/AlmostUnifiedRuntimeImpl.java @@ -76,12 +76,7 @@ public final class AlmostUnifiedRuntimeImpl implements AlmostUnifiedRuntime { var tagConfig = Config.load(TagConfig.NAME, TagConfig.SERIALIZER); var unificationConfigs = UnificationConfig.safeLoadConfigs(); - var unificationTags = bakeAndValidateTags( - unificationConfigs, - itemTags, - placeholderConfig, - debugConfig.shouldLogInvalidTags() - ); + TagReloadHandler.applyCustomTags(tagConfig.getCustomTags(), itemTags); CustomIngredientUnifierRegistry ingredientUnifierRegistry = new CustomIngredientUnifierRegistryImpl(); PluginManager.instance().registerCustomIngredientUnifiers(ingredientUnifierRegistry); @@ -89,7 +84,13 @@ public final class AlmostUnifiedRuntimeImpl implements AlmostUnifiedRuntime { PluginManager.instance().registerRecipeUnifiers(recipeUnifierRegistry); // TODO: add plugin support for registering config defaults - TagReloadHandler.applyCustomTags(tagConfig.getCustomTags(), itemTags); + var unificationTags = bakeAndValidateTags( + unificationConfigs, + itemTags, + placeholderConfig, + debugConfig.shouldLogInvalidTags() + ); + TagSubstitutionsImpl tagSubstitutions = TagSubstitutionsImpl.create( itemTags::has, unificationTags::contains,