Closed joazlazer closed 7 years ago
The Recipe system should be ready to merge. While OreDictionary
support hasn't been fully verified (since none of the recipes in vanilla are ore recipes), once this gets pushed, I can verify its support in my own personal development environment.
I have not implemented any of the more specialized vanilla IRecipe
implementations such as firework or banner crafting, but I don't believe these are a very high priority. (although it can be done if need be. It might be as simple as adding an if(recipe instanceof xxx)
to CraftingRecipeProvider.reloadCaches()
, although I'm not sure and don't care to try right now).
P.S. @gigaherz Please make a branch for your <span>
system so others can help / give feedback. Thanks!
Nice! I'll take a look as soon as I'm reasonably awake.
Looks amazing. I was planning to do something similar but I'm still in the middle of a massive rework of my own mod. However, there is one thing I was wondering about. Don't all recipes in 1.12+ have a unique identifier in the form a resource location? I didn't really look into 1.12 recipes that much yet but they have to be registered using a registry event and all registry entries must have a resource location as a registry name. So couldn't we also use this to load a recipe? At least that's the way I was planning to implement dynamic recipe loading. Could you also implement this if you have the time and motivation. I would do it myself but I have very little time recently which is why I am even struggling to update my own mod. Anyways both PRs look amazing, nicely done!
I'll take a look at it @Necr0, although I hadn't even thought of that. However, furnace recipes for example are not registered via json
and I would venture to bet most custom recipe systems aren't either. I can do it, though, because it would probably be better (and much more consistent) than the recipe indices.
Edit: I didn't realize you meant just using the registry key. Yeah, sure, that would definitely work and I'll add it in as another feature that would be an alternative to using the index
& <recipe.result>
system. (Once I get home and set up a dev environment on my desktop)
Ok, I added a registry key
feature and added in-game documentation & javadoc for it. Ready to merge @gigaherz
Nice, I'll take a look in a bit.
Changes
<recipe>
tag which allows the specification of thetype
of recipe via an attribute and the target resulting item through a<stack>
tag inside the sub-tag<recipe.result>
RecipeProvider
, an extensible abstract class that allows for the loading of recipes from other mods' custom recipe systemsRecipeProvider
s for existing vanilla recipe systems:FurnaceRecipeProvider
ShapelessRecipeProvider
ShapedRecipeProvider
Documentation
TODO
FurnaceRecipeProvider
ShapedRecipeProvider
ShapelessRecipeProvider
OreDictionary
supportTemplate
supportkey
recipe attribute and overloads forRecipeProvider.hasRecipe(...)
&RecipeProvider.getRecipeComponents(...)
that accept aResourceLocation
instead of a target outputItemStack