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

Try to fix energy overflow #114

Merged
merged 1 commit into from Mar 29, 2023
Merged

Try to fix energy overflow #114

merged 1 commit into from Mar 29, 2023

Conversation

D-Cysteine
Copy link

I think I've seen a few reports of the Ender IO staff of traveling and staff of teleportation somehow getting set to IIRC, near Integer.MIN_VALUE amount of stored energy. Reading through the code, the only way I could see for this to happen was if receiveEnergy or extractEnergy was called with a very negative number.

If I'm right about the cause, then this PR will fix the symptoms for Ender IO, but it won't fix the underlying issue that we have code somewhere which occasionally overflows and calls receiveEnergy or (less likely) extractEnergy with, I'm guessing, a value near Integer.MIN_VALUE, and any other mods that contain subclasses of ItemEnergyContainer may still be affected by the issue.

I don't know much about mix-ins, but we could also try putting these checks directly into cofh.api.energy.ItemEnergyContainer.

@D-Cysteine D-Cysteine requested a review from a team March 27, 2023 00:15
@Dream-Master Dream-Master requested a review from a team March 27, 2023 14:34
Copy link

@Pilzinsel64 Pilzinsel64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks ok. But for the qeustion about a general fix I'm not able to provide an answer, need to check someone else probably.

@Dream-Master Dream-Master merged commit 4e40230 into master Mar 29, 2023
2 checks passed
@Dream-Master Dream-Master deleted the fix-energy-overflow branch March 29, 2023 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants