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.

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

Featured Replies

Posted

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 !

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.

  • Author

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 !

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.

  • Author

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 !

I think you can do that for custom vanilla crafting table.

You just need to return the right stuff in getRemainingItems in ur custom IRecipe

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.