Skip to content

fix: Allow craft chains to have no output - #690

Closed
grimly wants to merge 2 commits into
GTNewHorizons:masterfrom
grimly:empty-crafting
Closed

fix: Allow craft chains to have no output#690
grimly wants to merge 2 commits into
GTNewHorizons:masterfrom
grimly:empty-crafting

Conversation

@grimly

@grimly grimly commented Aug 1, 2025

Copy link
Copy Markdown

Fixes GTNewHorizons/GT-New-Horizons-Modpack#20504

There were multiple instances where the item amounts or multipliers were forced up so that even if the items amounts outside crafting mode were zero, the crafting mode was showing at least one craft performed. It had other implications such as requiring two CTRL + scroll up instead of one to reach 2 output items

Auto crafting is not affected, since the auto crafter finds 0 items to craft, nothing is done

Fixes GTNewHorizons/GT-New-Horizons-Modpack#20504

There were multiple instances where the item amounts or multipliers were
forced up so that even if the items amounts outside crafting mode were
zero, the crafting mode was showing at least one craft performed.
It had other implications such as requiring two CTRL + scroll up instead
of one to reach 2 output items

Auto crafting is not affected, since the auto crafter finds 0 items to
craft, nothing is done
@grimly
grimly marked this pull request as ready for review August 1, 2025 01:02
@Dream-Master
Dream-Master requested review from a team and slprime August 1, 2025 02:36
@PlayfulPiano

Copy link
Copy Markdown

isn't this a duplicate of #682 ?

@slprime

slprime commented Aug 1, 2025

Copy link
Copy Markdown
Member

this PR doesn't make sense after #682

@slprime
slprime marked this pull request as draft August 1, 2025 05:26
@grimly

grimly commented Aug 1, 2025

Copy link
Copy Markdown
Author

Hello,

I agree, both PRs have the same goals but they don't share the same strategy.

This PR removes the work that should not have been done in the first place
#682 patches back the amounts continuously making double efforts for nothing.

I also observed why this shift was done. As one adds a favorite crafting chain, all intermediate recipes are requested for one more iteration and therefore growing the amounts of base items recursively. This is yet another bug to fix.
I could even raise yet another issue where we are no longer able to add a recipe with 0 iteration when pressing SHIFT+Q on the result. CTRL+SHIFT+Q is meant for that purpose and maybe adding a favorite crafting chain should follow the same pattern.

@slprime

slprime commented Aug 1, 2025

Copy link
Copy Markdown
Member

I could even raise yet another issue where we are no longer able to add a recipe with 0 iteration when pressing SHIFT+Q on the result. CTRL+SHIFT+Q is meant for that purpose and maybe adding a favorite crafting chain should follow the same pattern.

It's not a problem. It was intended that way. the player very rarely needs to add a recipe without a quantity. and i wanted to reduce the number of buttons for frequently used behavior

@slprime

slprime commented Aug 1, 2025

Copy link
Copy Markdown
Member

This PR removes the work that should not have been done in the first place
#682 patches back the amounts continuously making double efforts for nothing.

it doesn't behave as it was originally intended

comment 690 682
default state image image
When you enable the crafting chain it should display the output recipes. (x1) image image
one scroll up. it show how many items you get it if chain crafted image image
one scroll down. look to redstone. in 682 showing what it not needed for this chain. (have 0 stack size) image image

In 682 i fixed behavior when one scroll change multiplier from 0 to 2 GTNewHorizons/GT-New-Horizons-Modpack#20459

I don't deny that I could have missed some behavior that you thought of. If there is something, please give an example. Otherwise, this PR breaks the basic behavior that was originally intended.

@grimly

grimly commented Aug 1, 2025

Copy link
Copy Markdown
Author

Here we have 2 opposing visions.

I should point out that crafting mode and non-craft mode do not reconcile very well with the strategy from #682 .

Strategy Non-Crafting mode Crafting mode
#682 Switching between crafting and non-crafting do not convey the number of expected items, you're always off by one. Observe here the crafting mode results will leave you 2 planks short if you needed the 32. image image
#690 You may set your expectations with the correct amounts in non-crafting mode then in crafting mode you'll find everything you will produce image image

I am biased toward my solution not because I wrote it, but this is something I extensively use for instance with motors as they are also ingredients themselves or when working with multiple tiers of circuits. This is a QoL feature we are losing from 2.7 .

Maybe you have a bigger strategy in mind that would resolve this dissonance between crafting and non-crafting modes and I'd be happy to learn about it.

Also, I do agree 100% that #690 creates a regression when importing a favorite crafting chain. That's a new feature I didn't extensively use yet and I overlooked it in my manual tests. I had a quick look at how it's written and I agree the current state does not intent to add a non-zero copy of a craft, which is against #690 strategy.

@slprime

slprime commented Aug 2, 2025

Copy link
Copy Markdown
Member

@grimly,
From what I've seen, players usually add a recipe with a quantity to get an idea of what they need. And if they need to calculate a chain, they just turn it on. This automatically gets the calculation for the root recipe, and all the others become part of the chain. The fact that there can now be one less intermediate recipe when you turn on a chain is a compromise.

Your version initially requires you to add recipes without a quantity or scroll through the intermediate recipes before turning on the chain, and if you turn off the chain, you have to scroll through all the recipes again by one. This breaks the usual behavior of players.

If I understand correct, you use recipes without a quantity. If so, I could revert the Shift + Ctrl + A shortcut back, and then we will have the behavior that was in version 2.7.4.

@slprime

slprime commented Aug 2, 2025

Copy link
Copy Markdown
Member

if i split shift+a and shift+ctrl+a what it was in 2.7.4 then it full restore behaviour of 2.7.4

@grimly

grimly commented Aug 3, 2025

Copy link
Copy Markdown
Author

My version does not require you any action on intermediate recipes, it's just that the favorite recipe import was not adapted. I since added changes to it and you can test my latest commit. The behavior of 2.7 is back: you press CTRL if you want the amount or you have it with zero amounts.

Going in or out crafting mode had to preserve some meaning between the two and my idea I expect to preserve from 2.7 is that you find your results only in non crafting mode and it computes all your steps in crafting mode.

I also remembered doing this that CTRL+A had this meaning already of preserving the amounts. Useful for multiblocks btw.

I didn't push it but I like the amount selector (bottom right) that defaults to a stack and how the ALT modifier was also linked to it. My idea for using an integer rather than a boolean is that maybe we could extend the idea on recipe import.

Basically :

  • SHIFT: deal with recipes
  • CTRL: preserve amounts
  • ALT: modify scale with default to a stack

The bookmark panel is a really nice piece of work that has meaning to all actions down to even the modifier keys like I described. I am surprised you want to tear that down unless you have a new vision and logic that I cannot grasp. I also do not find a reason for the non-crafting mode in your version.

@slprime

slprime commented Aug 3, 2025

Copy link
Copy Markdown
Member

The basic functionality was that people first add recipes with quantities to understand how many ingredients are needed to craft a recipe and only then, if they want, turn on the crafting chain to calculate dependencies.

Your changes break this basic principle: players will have to reduce the amount of "Iron Ingot", "Oak Wood Planks", and "Redstone" each time they turn on the chains, and add it back when they turn them off. This is a significant change that was not in version 2.7.4.

PR default chain
#682 image image
#690 image image

Your idea has a right to exist, but players are used to it and it is more intuitive for them when they see the number of ingredients in the off state, and when the chain is turned on, the algorithm ignores recipes with a multiplier x1, except root recipes.

When I made this functionality I tested it on players over a long period of time to understand how it would be convenient for the majority. I don't think it's worth changing.

P.S.
I split the ctrl modifier in #682, as it was in 2.7.4

@slprime

slprime commented Aug 3, 2025

Copy link
Copy Markdown
Member

example of use from discord. how you see he added recipes with amount

image image

This is a continuation of the restauration of a zero output recipe on
the bookmark panel. The previous commit introduced an issue, most visible
on importing a favorite crafting chain, where ingredients would accumulate
recursively through the crafting chain.

The API is left open for more recipe iterations, attempts should be made
to test the user experience of adding a recipe 64 times or for a set
amount through ALT+CTRL combo.

SHIFT+A adds a recipe zero times (2.7 behavior)
SHIFT+CTRL+A adds a recipe one time (2.7 behavior)
Same behavior is followed by the favorite icon but only the leading
recipe may have an amount
@grimly

grimly commented Aug 5, 2025

Copy link
Copy Markdown
Author

I'll stay respectful and discard my PR.

I thank you for how this mod added so much value to GTNH and wish you good luck.

@grimly grimly closed this Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NEI - Crafting chain mode cannot go down to 0 products

3 participants