Item Scroller

Item Scroller

6M Downloads

[Bug] Mass craftEverything not using precise amounts of resources for rockets

GreenGinkgo opened this issue ยท 0 comments

commented

MC version: 1.16.5
Item scroller: v1.15.0-dev.20210111.205029

When using the craftEverything feature to make rockets, You will sometimes get different types of rockets. Specifically, it may craft 1, 2, or 3 second rockets despite only executing the recipe for 3-second rockets. This does not seem to happen every time, but In trying to make around a chest of rockets (27 stacks), there resulted also 3 rockets that only have a 2 second duration. This implies that one of the slots of gunpowder had a smaller stack than the others, and ran out mid-crafting.

Testing more deliberately, I found that if you had gunpowder in your inventory at an imperfect ratio versus paper, you can get incorrect rocket types. I tested this by having 6 paper and 16 gunpowder in inventory (6 and 18 would be a perfect ratio of 1:3). When executing craftEverything, it seems that the function split the 6 gunpowder into uneven stacks (5, 5, 6), resulting in 15 3-second rockets, and 3 1-second rockets. Each paper used rocket crafting yields 3 rockets, so that mean that there were 5 cycles of 3 gunpowder + 1 paper, and one cycle of 1 GP + 1 paper. This issue even occurs with full, but incorrect ratio, stacks, as 64/3 = 2 stacks of 21, and 1 stack of 22. So if you had a single stack of gunpowder in your inventory and enough paper, you would get 63 longer rockets and a single 1-second rocket.

If it does not exist already, can you please implement a recipe completeness check that checks for partial stacks before firing the crafting action? Or maybe only load precise stacks into the crafting interface instead of doing a split of whatever is in inventory and putting all of it into the crafting interface? This might only need to be done for rockets (might be simpler to code), but I can foresee it being useful for custom datapack recipes, so making it universal may be more elegant.

Thanks so much for your hard work!