[Bug] Item Output Bus incorrect stack merging
OneEyeMaker opened this issue ยท 1 comments
Item Output Bus incorrectily merges stacks: instead of filling one stack and placing reminder it fill one stack and places whole output.
Example:
I made Pyrolyse oven multiblock (via JSON) and built it in game for testing. Recipe should consume 16 wood and produce 20 charcoal and creosote. After placing two stacks and starting processing I looked at result in output hatch. Result:
- 20 charcoal (after 1 operation)
- 40 charcoal (after 2 operations)
- 60 charcoal (after 3 operations)
- 64 (stack) and 20 charcoal (after 4 operation) instead 64 and 16.
In other words, multiblock fills first stack and places whole result instead of reminder.
MC version: 1.12.2
Mod version: 1.5
Forge build: 2491
Maybe, bug is there:
https://github.com/HellFirePvP/ModularMachinery/blob/master/src/main/java/hellfirepvp/modularmachinery/common/util/ItemUtils.java#L157
You use both stack
and toAdd
and confuse its:
- You reduce count of
stack
in this branch - But you get count of
toAdd
(which isn't changed) in this branch
In this place you don't need two variables (one is enough - it reduces stack copying and will clean code).
And I guess it's not only cause of this bug.