quilt-standard-libraries icon indicating copy to clipboard operation
quilt-standard-libraries copied to clipboard

Recipe Book API

Open LambdAurora opened this issue 3 years ago • 1 comments

Why?

Recipe Book is one of Minecraft's greatest additions, it makes recipes more accessible, especially to new players.

Despite some people not liking it's UI, it's still an useful tool which should not be ignored.

Mojang's mistake

Currently, mods can register custom recipe types, which is great! Until you hit the recipe book.

Let's address the elephant in the room: RecipeBookGroup. It's an enum, one of modders' worst nightmare.

When there's a recipe using a custom recipe type, the client will call ClientRecipeBook#getGroupForRecipe(Recipe). And it's an if-else chain! If it falls through the fallback else block, it'll log to the console that the recipe type doesn't have a recipe book category.

That's quite an amount of issues.

What should we do about it?

The proposal is simple: allow modders to register custom recipe book groups. One of the challenging part is to replace the enum, which would require quite an uncomfortable amount of injections. Hopefully a good solution for that can be figured out.

What's to do first?

Well, before even thinking how to implement this, let's think first if we should provide this API. I invite anyone reading this issue to to indicate their opinions on whether to include this API in QSL, or not.

LambdAurora avatar Jun 22 '21 13:06 LambdAurora

I think using the recipe book is a great idea that more mods should adopt, and this would be a great way to increase adoption.

I can see the largest contention for this is that many modders think the recipe book is not worth dealing with. And some users specifically look for mods that remove the recipe book. However, as the recipe book is a solid vanilla system, I'm of the opinion an API to make use of it for modded recipes should be included in QSL. Allowing modded recipes in the recipe book (and thus let modded machines make use of the recipe book) would also lower the disconnect from vanilla and bar to entry that modded machines can often cause, providing much nicer transitions for users newer to modding.

Platymemo avatar Jun 23 '21 03:06 Platymemo