You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm creating this issue primarily to share my fix and let you know that this is a known issue, but also to possibly make a change.
I'm using mojmap.
Vanilla, for creating advancements that unlock recipes, uses the namespace of the item rather than the recipe itself. You can see that in RecipeBuilder::save.
This quite unobvious logic results in recipes for items not of this mod having no real working unlock advancements!
Should the FabricRecipeProvider report this somewhere in the docs?
I previously used FabricRecipeProvider::getRecipeIdentifier when exporting a recipe, but this is no longer possible in newer versions as recipes are now created outside of FabricRecipeProvider (in RecipeGenerator impl, or in an anonymous class).
Anyway, my simple fix:
@OverridepublicvoidbuildRecipes() {
ItemrecipeResult = ...; // item not of this modrecipeBuilder(recipeResult)
.save(output, useModNamespace(recipeResult)) // RecipeBuilder::save
}
privateResourceKey<Recipe<?>> useModNamespace(Itemitem) {
returnResourceKey.create(Registries.RECIPE, ResourceLocation.fromNamespaceAndPath("modid", RecipeBuilder.getDefaultRecipeId(item).getPath()));
}
The text was updated successfully, but these errors were encountered:
We can also use Interface Injection and add our own version of RecipeBuilder::save that would use (somehow) the mod namespace (or just static util class)
I'm creating this issue primarily to share my fix and let you know that this is a known issue, but also to possibly make a change.
I'm using mojmap.
Vanilla, for creating advancements that unlock recipes, uses the namespace of the item rather than the recipe itself. You can see that in
RecipeBuilder::save
.This quite unobvious logic results in recipes for items not of this mod having no real working unlock advancements!
Should the
FabricRecipeProvider
report this somewhere in the docs?I previously used
FabricRecipeProvider::getRecipeIdentifier
when exporting a recipe, but this is no longer possible in newer versions as recipes are now created outside ofFabricRecipeProvider
(inRecipeGenerator
impl, or in an anonymous class).Anyway, my simple fix:
The text was updated successfully, but these errors were encountered: