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

I want to determine the inputs, as strings, from an OreDictionary recipe. For example, for an iron pickaxe get the inputs as:

["ingotIron", "ingotIron", "ingotIron", "null", "stickWood", "null", "null", "stickWood", "null"]

Maker of the Craft++ mod.

Those are the String used as keys in the OreDictionary. You can get an

ArrayList<ItemStack>

using

OreDictionary.getOres()

and as a parameter the Strings you get, to get the ItemStacks that can be used for the recipe.

 

BTW, what are you trying to do? Are you sure there isn't another way of doing what you are trying to do?

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • Author

Those are the String used as keys in the OreDictionary. You can get an

ArrayList<ItemStack>

using

OreDictionary.getOres()

and as a parameter the Strings you get, to get the ItemStacks that can be used for the recipe.

 

BTW, what are you trying to do? Are you sure there isn't another way of doing what you are trying to do?

I want to do it the other way around. From an ore dictionary recipe, get the inputs as strings.

 

 

And my mod is unique,

Maker of the Craft++ mod.

You have 2 kinds of OreRecipe: ShapedOreRecipe and ShapelessOreRecipe.

 

The ShapedOreRecipe object has a method called getInput() which gives you an array of Objects, which are either an ItemStack, an ArrayList<ItemStack>, or null.

 

The ShapelessOreRecipe has the same method, but returns an ArrayList<Object>. The objects in the arraylist are, once again, an ItemStack or an ArrayList<ItemStack>.

 

There is a trick to get the orename from that arraylist of itemstacks (since that's the collection that contains all possible itemstacks). If you can't figure it out I'll tell you, but I don't feel like spoonfeeding you everything. Let's see if you can figure this one out. :3

 

Good luck!

  • Author

Alright I figured it out, first get the list of ore IDs for the stack, stream them and map them to their corresponding name. Thanks for the help guys.

Maker of the Craft++ mod.

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.