diff --git a/gradle.properties b/gradle.properties index ec898a8..9bc2fb6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ bta_version=7.1-pre2a loader_version=0.15.6-babric.4-bta # Mod -mod_version=3.4.16 +mod_version=3.4.17 mod_group=turniplabs mod_name=halplibe diff --git a/src/main/java/turniplabs/halplibe/mixin/mixins/RecipeRegistryMixin.java b/src/main/java/turniplabs/halplibe/mixin/mixins/RecipeRegistryMixin.java new file mode 100644 index 0000000..03ed7c7 --- /dev/null +++ b/src/main/java/turniplabs/halplibe/mixin/mixins/RecipeRegistryMixin.java @@ -0,0 +1,18 @@ +package turniplabs.halplibe.mixin.mixins; + +import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.core.data.registry.recipe.RecipeRegistry; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import turniplabs.halplibe.util.RecipeEntrypoint; + +@Mixin(value = RecipeRegistry.class) +public class RecipeRegistryMixin { + + @Inject(method = "", at = @At("TAIL")) + public void init(CallbackInfo ci){ + FabricLoader.getInstance().getEntrypoints("recipesReady", RecipeEntrypoint.class).forEach(RecipeEntrypoint::initNamespaces); + } +} diff --git a/src/main/java/turniplabs/halplibe/util/RecipeEntrypoint.java b/src/main/java/turniplabs/halplibe/util/RecipeEntrypoint.java index 0ecba09..40e7140 100644 --- a/src/main/java/turniplabs/halplibe/util/RecipeEntrypoint.java +++ b/src/main/java/turniplabs/halplibe/util/RecipeEntrypoint.java @@ -1,6 +1,7 @@ package turniplabs.halplibe.util; -@FunctionalInterface public interface RecipeEntrypoint { void onRecipesReady(); + + void initNamespaces(); } diff --git a/src/main/resources/halplibe.mixins.json b/src/main/resources/halplibe.mixins.json index 1b218b9..c10eae0 100644 --- a/src/main/resources/halplibe.mixins.json +++ b/src/main/resources/halplibe.mixins.json @@ -4,6 +4,7 @@ "package": "turniplabs.halplibe.mixin", "compatibilityLevel": "JAVA_8", "mixins": [ + "mixins.RecipeRegistryMixin", "accessors.BlockFireAccessor", "accessors.EntityFireflyFXAccessor", "accessors.EntityFXAccessor",