Jump to content

Recommended Posts

Posted

So I am creating a furnace with multiple inputs and I have it working with 1 recipe,the problem comes when I add another recipe. (I know there's many threads on this subject,I have read them all)

I don't think it is too complicated but it's outside my understanding,the TileEntity,Container and everything else is as they should be.

The problem is that it doesn't differentiate between the recipes,it treats recipe 1 and recipe 2 as the same and therefore you can use half of each.

This may be due to multiple smelting methods,which I have but I feel like I'm close to solving it however I need just a little more help.

The recipe class code is here: http://pastebin.com/puPbdvhf

 

I think the issue is that I have an addSmelting and addDoubleSmelting when declaring the recipes.

Therefore what I'd like ask is: could anyone tell me how I can set addDoubleSmelting to equal addSmelting twice?

e.x addDoubleSmelting = addSmelting + addSmelting

 

if any other code is necessary then tell me and I'll give it to you.

 

Thank you for your time.

Sincerely,

Erik Zetrov

Posted

Basically, all you did is merging two furnaces into one.

That isn't what you want to do, is it ? (even if it was, you wouldn't do it this way)

The smelting list (which is a map) needs to be unique for inputs to be linked.

All that a smelting map does, is saving input as key, and output as value.

Now, all you need to figure out, is what your inputs and outputs should be, coding-wise.

Posted

Basically, all you did is merging two furnaces into one.

That isn't what you want to do, is it ? (even if it was, you wouldn't do it this way)

The smelting list (which is a map) needs to be unique for inputs to be linked.

All that a smelting map does, is saving input as key, and output as value.

Now, all you need to figure out, is what your inputs and outputs should be, coding-wise.

 

And that is EXACTLY why I started this thread,I don't know how it should be coding-wise.

If I did then I wouldn't have to ask.

I'm looking for help so that I can be pointed in the right direction,what you basically said confirms what I already know. (sorry,if I sound sarcastic or ungrateful for your insight)

Posted

Well, this has already been discussed in other threads...

Inputs should be a group of ItemStacks...just build a structure that group them. A class, an array, a list...your choice !

The only things is, you'll have to be able to compare two groups so that each key (ie inputs or "group" of itemstacks) in the map is unique.

Outputs can be the same structure, with the resulting ItemStack, or something different.

 

A void example with arrays:

Map dualSmeltingList = new HashMap();
ItemStack[] inputs = new ItemStack[2];
ItemStack[] outputs = new ItemStack[2];
dualSmeltingList.put(inputs,outputs);

Posted

I have been fiddling around with that idea since you mentioned it and I am getting closer to what I am looking for.

Slowly but surely I make progress,it's just a question about time now I guess until I get it right.I have an idea about

how I can solve it now,so just gotta learn a few things related to arrays.

Thanks for your insight.^^

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.

Announcements



×
×
  • Create New...

Important Information

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