-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Item counts in NEI pinned recipe chains are buggy #17148
Item counts in NEI pinned recipe chains are buggy #17148
Comments
This is an issue purely with NEI, so it might make more sense in NotEnoughItems' repo. Whatever you guys decide |
Looked a bit through the code, found a bunch of problems and inconsistensies (like using ItemStack as key in hashable containers). So, if everyone is alright with it, I'm gonna try to rewrite that part of code. And maybe make a recipe graph, as described here GTNewHorizons/NotEnoughItems#487 |
P.S. I think you haven't grasped all the possibilities and flexibility of this functionality |
You mean Shift+Scroll? Yeah, I got that. But I'm not sure if that's really necessary. Because (assuming vanilla recipes), I added a chest recipe, a hopper recipe and a chest minecart recipe. Then I shift+scrolled on planks in chest recipe. What is supposed to happen now? Does hopper take priority? Or minecart?
Aha. I was planning to do this as well, but with completely locked ingredient amounts. So if you need to get a sum of items, or reduce/increase it, you pin that item.
Whatever was in main branch at the time of creating this ticket.
In general speak. I want to add a separate counter for requested items into metadata, decoupled from current ItemStack size, stored in
I looked into how Applied Energestics appears to do it (by behaviour, I did not look into code). Which is, go until you encounter a loop, and instead of continuing on, just don't add any more recipes to the queue from this branch. Which means, that adding Block->Ingot recipe and Ingot->Block recipe to the chain and requesting 10 blocks, you will see two recipes: 10 blocks <- 90 ingots, and 90 ingots <- 10 blocks.
In my book this is just a relatively simple graph traversal with a couple extra steps. The biggest hurdle is just minecraft code in general. |
P.S. It would make sense to remove ctrl+scroll then. And for change count always use shift+scroll |
I was honestly thinking ctrl+scroll to adjust single output item quantities, to match non crafting chain mode. Meaning you can "request" 5 planks, and get told that you need 2 logs, you'll get your 5 planks plus 3 remaining (will be shown in the tooltip). As for shift, I don't know. To match current behavior as closely as possible, I am thinking about increasing requested amount by "one craft" (i.e. 4 for planks). And probably allowing to scroll on inputs as well (it will increase requested output amount). If recipe has multiple outputs, all outputs will increase by one craft.
I'm not planning to distinguish between intermediate and final recipes, because any intermediate recipe can become both intermediate and final recipe at any moment, if you request some of that item. The exception is background colors while holding shift:
The thing I haven't figured out yet, is what numbers to show. Currently the plan is as follows:
|
What do you mean by the word "request"? P.S. English is not my main language :) |
Your GTNH Discord Username
Meegoo
Your Pack Version
2.6.1 (Reproduced with only NEI in dev environment)
Your Server
SP
Java Version
Java 17
Type of Server
Single Player
Your Expectation
Something consistent. Here is what I think is the intended behavior.
Screenshots with messy item counts for reference
The Reality
Scrolling can randomly lead to item counts breaking. I don't have exact steps to reproduce, but it seems to be some sort of race condition. Did not debug too deep, but
BookmarkCraftingChain::calculatedItems
seems to become complete nonsense after some fiddling with Ctrl+scroll.In this state, scrolling down on input planks for a chest, causes plank amount to go up by 8. The reason for that is the mapping
232x -> 248x
inBookmarkCraftingChain::calculatedItems
.BookmarkGrid::realItems
, as seen from this method, contains 232x, butgetSlotMouseOver(mousex, mousey)
(which eventually looks intoBookmarkCraftingChain::calculatedItems
returns x248. 248 gets decreased by 8 to 240, and then I guesscalculatedItems
gets updated, and232x -> 248x
becomes240x -> 256x
.There is also some other nonsense, like 0x oreIron -> 1x oreIron, which is visible in game as ore count going down as I scroll down on iron ingots, ore count dropping to zero, and then, on next scroll down, setting itself from 0 to 1, without touching iron ingots.
Toggling recipe chain seems to temporarily fix it. I suppose because
BookmarkCraftingChain::calculatedItems
gets... recalculatedYour Proposal
Not having that bug would be nice, but I have other proposals to improve UX of this feature.
On first screenshots there is 4 chests in input for hopper crafts, and 5 as output from planks. 5 is calculated as 4 requested by hopper plus one extra craft that is "requested" by me (shown in blue with 1 in bottom right). When i scroll chests in hopper inputs up, amount of chests that is requested by me decreases by 1. Same in opposite direction, but not always. If I previously messed with counts of chests, it goes down up to the amount I messed with, and then starts adding items as if they were requested by me. That doesn't make much sense
Also, I would argue that input count in recipe should max out at whatever recipe requests, so in my example, for hopper recipe, chests should be maxed at 2 and iron at 10. But the amounts should be adjustable individually, not in steps of "one recipe", and this adjustment should be shown explicitly, as an offset from requested amount. This would be useful when I have 3 iron, so I can set iron requirement to 7, and with shift pressed it would show
-3
somewhere. For intermediates it's slightly more complex, because you can have multiple recipes requesting iron. So maybe forcing amount of intermediates in inputs to always be equal to requested amount, but allowing adjustment on recipe that produces said intermediate. With similar-3
shown.And last but not least, this
doesn't make much sense either. At the very least extra hoppers without associated inputs should not be marked as requested
Final Checklist
The text was updated successfully, but these errors were encountered: