Applied Energistics 2

Applied Energistics 2

156M Downloads

Large Fluid Disks cause integer overflow

Tfarcenim opened this issue ยท 1 comments

commented

Due to some downcasting from long to int in BasicCellInventory https://github.com/AppliedEnergistics/Applied-Energistics-2/blob/8.4.x-1.16.x/src/main/java/appeng/me/storage/BasicCellInventory.java#L162, large cells can overflow due to storage exceeding 2 billion.

This isn't possible to recreate in base AE2 as the disks aren't large enough, but if larger disks were ever added, then it would be triggered.

In game, this will manifest as seemingly empty storage drives not being able to hold any fluid, or not holding as much as they claim, in this case, all fluid storage drives above 256k from AE2 Extras are affected by the integer overflow.

To Reproduce

Expected behavior
The expectation is that the disks, including those created by addons would work past Integer.MAX_VALUE storage.

Additional context

Simple infinite water generator

2021-09-12_13 04 05

As noted above, the disk never gets even a millibucket of water.

2021-09-12_13 04 20

Forced Crash: https://pastebin.com/uUk8u4iQ

Environment
AE2 version: 8.4.1
Minecraft version: 1.16.5
JEI version: 1.16.5 - 7.7.0.98
AE2 Extras: 1.3

commented

Duplicate of #4352