Jump to content

[1.8.9][SOLVED] Make a recipe that needs more than 1 Item unit on the same slot


Major Squirrel

Recommended Posts

Good evening,

 

Everything is in the title. I tried myself using new ItemStack(Items.something, 3) for testing, it obviously didn't work.

 

According to a Wuppy's tutorial, it seems that it isn't possible to do it. But his tutorial is dated from 2014, and I'd like to know if anyone had achieved it for 1.8.9 ?

Squirrel ! Squirrel ! Squirrel !

Link to comment
Share on other sites

You would need to write your own crafting bench and your own recipes.

 

I have a machine that takes in stacks of size 8 and produces a single-size result, for example.

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

You would need to write your own crafting bench and your own recipes.

 

I have a machine that takes in stacks of size 8 and produces a single-size result, for example.

 

Thanks Draco18s for the tip. :) Is there any way to make it craftable from a basic workbench ?

 

(If not, I would suppose that the "1 unit" consumption is coded in the workbench directly)

Squirrel ! Squirrel ! Squirrel !

Link to comment
Share on other sites

I haven't looked, but pretty sure that the vanilla workbench has it hardcoded to only use one of each.  There are custom IRecipe implementations, but while you could make the output not show up unless 3 of the item were in a stack, I don't think it would actually use all three.

 

Here's what my block does, it's very single-purpose, pro-automation.

http://reasonable-realism.wikia.com/wiki/Sifter

The stack-of-eight is actually an efficiency improvement over the workbench crafting recipe (uses 9).

(And the second input slot is just a buffer area, like the hopper)

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

I haven't looked, but pretty sure that the vanilla workbench has it hardcoded to only use one of each.  There are custom IRecipe implementations, but while you could make the output not show up unless 3 of the item were in a stack, I don't think it would actually use all three.

 

Here's what my block does, it's very single-purpose, pro-automation.

http://reasonable-realism.wikia.com/wiki/Sifter

The stack-of-eight is actually an efficiency improvement over the workbench crafting recipe (uses 9).

(And the second input slot is just a buffer area, like the hopper)

 

Thank you for the reference. I will keep this link to take a look at implementation !

 

In 1.8.9 you can actually make this work with a bit of a hack.

Make a custom recipe class (implementing IRecipe). In the matches method you can check if the stack sizes of the supplied crafting inventory are sufficient. Then in the

getRemainingItems

method decrease the stacks in the crafting inventory by

n - 1

each (n being the total amount needed in that slot). -1 because vanilla will also still consume 1 Item. Once you have done that call

ForgeHooks.defaultRecipeGetRemainingItems

and return the result.

 

I didn't think about that ! Thank you too. :)

 

I will mark this as solved since you both gave explanations and ways to implement it !

Squirrel ! Squirrel ! Squirrel !

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.