Posted November 19, 20177 yr So, as we may know, GameRegistry.register(); is not used anymore. And I have see that we use RegistryEvents to register items and blocks. Yet the only way I can find to register recipes is through GameRegistry.addRecipe. Is this still correct, or is there a new event that is used to register recipes within the game? Also, if there is no other way, when do I call the registerRecipes() function? preInit() | Init() | postInit() ? Edited November 19, 20177 yr by MSpace-Dev
November 19, 20177 yr You should use json files instead of creating them in code. Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
November 19, 20177 yr Recipes are now managed by a Forge registry, so IRecipe extends IForgeRegistryEntry and instances of it should be registered in RegistryEvent.Register. As Kokkie said, you should use JSON files wherever possible. You can register your own recipe, ingredient and condition factories to extend the JSON system. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
November 19, 20177 yr Author Alright, I'll look for a resource that can get me started. Thanks for the replies!
November 19, 20177 yr Author I have a question about the JSON files. Do you really have to have 1 JSON file per recipe? I have this at the moment, can I add another recipe in this file? { "type": "crafting_unshaped", "pattern": [ "III", "III", "III" ], "key": { "I": "boe:tin_ingot" }, "result": { "item": "boe:tin_block" } } Edited November 19, 20177 yr by MSpace-Dev
November 19, 20177 yr Author Also, what version do JSON recipes work in? From what version onwards? Cause, I have my suspicions that it is 1.12 onwards, but I'm only in version 1.11. Edited November 19, 20177 yr by MSpace-Dev
November 19, 20177 yr 1 hour ago, MSpace-Dev said: I have a question about the JSON files. Do you really have to have 1 JSON file per recipe? I have this at the moment, can I add another recipe in this file? It's one JSON file per recipe, yes. 1 hour ago, MSpace-Dev said: Also, what version do JSON recipes work in? From what version onwards? Cause, I have my suspicions that it is 1.12 onwards, but I'm only in version 1.11. Ah, I missed the version in the thread title. JSON recipes and the recipe registry were added in 1.12, 1.11 still uses the old recipe list system. In 1.11 and earlier, recipes should be registered in init. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
November 19, 20177 yr Author Awesome thanks for the help with the registering in this version. When I move onto to 1.12 some time, now I know about the JSON capabilities, so that'll help moving forward. Gonna keep cracking on! Edited November 19, 20177 yr by MSpace-Dev
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.