Skip to content

Injected Interface FabricRecipeExporter isn't implemented via mixin. #5007

@RubixDev

Description

@RubixDev

#4703 introduced the FabricRecipeExporter interface to the data generation API, which is injected into the RecipeExporter interface. The contributing guidelines state, that alongside every injected interface should come a mixin which implements it.

  • Interface injection requires both a fabric.mod.json custom value to make it visible in Minecraft source code, and a mixin to actually implement the interface at runtime.

This isn't the case for FabricRecipeExporter though. I believe this wasn't done, because vanilla Minecraft only uses the RecipeExporter during its data generation and Fabric API also only constructs instances with the new interface, also only during data generation. So this never lead to any issues during gameplay.

In my case, I'm using the various RecipeJsonBuilders during normal game execution though, which then broke when invoking offerTo because a Fabric API mixin assumed the existence of the added method. My fix for that is currently to just have this implementation mixin in my mod, as you can see here. I believe this should just be included in Fabric API itself, though, unless I'm missing something.

The affected branches are 1.21.1, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, and 1.21.11 as far as I can tell.

If the fix is really just to add such a mixin, I'd be happy to open a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions