Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 by MSpace-Dev

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.

  • 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 by MSpace-Dev

  • 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 by MSpace-Dev

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.

  • 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 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.