Skip to content
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

Fix Quantum Chest voiding items near maximum capacity #1724

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ALongStringOfNumbers
Copy link
Collaborator

What:
This PR fixes an issue where the quantum chest would void items when near maximum capacity in certain situations.

This fix is done by preventing returning early when trying to insert more items than the available remaining space, resulting in the item merge actually proceeding.

This bug was produced using the following conditions:

Give yourself a quantum chest full of iron ingots using the command /give @p gregtech:machine 1 1010 {ItemAmount: 4096064L, ItemStack: {id: "minecraft:iron_ingot", Count: 1, Damage: 0}}

Place the chest and place a fluid solidifier (best at EV for the speed) next to the chest and set its auto output into the chest and enable the auto output.

Build up a backstock of iron in output slot of the solidifier, and fluid iron in the tank of the solidifier.

Remove half a stack of iron from the quantum chest by right clicking on the stack of iron in the output slot.

See the chest refill itself from its internal inventory and from the fluid solidifier, however see that it never reaches its maximum stored amount and continuously drains iron from the fluid solidifier output, voiding the excess iron and newly created iron.

How solved:
Not returning early allows the merge to actually succeed and properly update the inventory, which prevent this issue. And also returns the correct remaining itemstack from the partial merge from the output slot of the fluid solidifier.

Outcome:
Fixes the Quantum Chest voiding items inserted into it in some cases when near/at maximum capacity.

Possible compatibility issue:
None expected.

serenibyss added a commit to GregTechCEu/GregTech that referenced this pull request Oct 31, 2021
https: //github.com/GregTechCE/GregTech/pull/1724
Co-Authored-By: ALongStringOfNumbers <[email protected]>
Exaxxion added a commit to Nomifactory/Nomifactory that referenced this pull request Jan 28, 2022
Pending GTCE PRs:
	GregTechCE/GregTech#1623
	GregTechCE/GregTech#1724
	GregTechCE/GregTech#1733

Lang file adjustment:
	Fixes #852 by overriding the electrolyzer name in lang files

All changes source code is here:
	Nomifactory/GregTech@master...bansoukou
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.

3 participants