Jump to content

[1.7.10] Getting the lists of recipes for arbitrary machines


Nephroid

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

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