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

Hello all. Is there a way to get the list of recipes for any machine? I know that vanilla smelting recipes are stored in

FurnaceRecipes

and crafting recipes are stored in

CraftingManager

, but I don't know where to find the recipes for a non-vanilla machine (e.g. a pulverizer from Thermal Expansion).

 

To be more precise, I want to write a function,

getRecipes(ItemStack [b]i[/b])

, such that if

[b]i[/b]

is a machine that has recipes associated with it,

getRecipes

will return that list of recipes.

 

It seems like this is possible, since NEI is able to list the recipes for machines from many mods.

 

Of course, hard coding is a solution, but that's probably not the best way of doing it.

Good f*sking luck with that.

 

Every mod is going to store their own machine's recipes in their own classes.

 

For the mod I'm doing, that's one class (with several getters).  For other mods, it might be many classes.  For Thermal Expansion, download their API.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

The only reason NEI is able to do that, is because those mod authors integrate with NEI by using the NEI API and creating their own 'plugins'.

 

Perhaps if there was a standardised IMachine interface this would be possible (obviously with the interface intended for TileEntities), however then you get the problem of getting the list of recipes back in that method, since not every mod keeps their recipes stored as IRecipe.

 

I suggest getting all the APIs and/or dev versions of the mods, and simply integrating with each one individually.

BEFORE ASKING FOR HELP READ THE EAQ!

 

I'll help if I can. Apologies if I do something obviously stupid. :D

 

If you don't know basic Java yet, go and follow these tutorials.

since not every mod keeps their recipes stored as IRecipe.

 

I certainly haven't been.  It's a 1:1 input:output in terms of ItemStacks.  Kind of like the furnace.  Stack of A becomes a Stack of B, so I've just been storing it as a HashTable<ItemStack,ItemStack>.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

since not every mod keeps their recipes stored as IRecipe.

 

I certainly haven't been.  It's a 1:1 input:output in terms of ItemStacks.  Kind of like the furnace.  Stack of A becomes a Stack of B, so I've just been storing it as a HashTable<ItemStack,ItemStack>.

 

This is exactly why support for every individual mod is needed to do something like this.

 

Off-topic: Any reason you're using a HashTable over a HashMap?

BEFORE ASKING FOR HELP READ THE EAQ!

 

I'll help if I can. Apologies if I do something obviously stupid. :D

 

If you don't know basic Java yet, go and follow these tutorials.

Oh, it is a HashMap.  Heh.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Makes since.  I was largely working off how the Furnace recipes worked, but yeah, it doesn't make a whole lot of sense that way.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.