GregTechCEu / GregTech-Modern

GregTech CE Unofficial for modern versions
GNU Lesser General Public License v3.0
295 stars 175 forks source link

Large Tungsten Boiler steam production int overflow #2399

Closed Miner239 closed 4 days ago

Miner239 commented 1 week ago

Checked for existing issues

Tested latest version

GregTech CEu Version

GTM 1.5.3

Minecraft Version

1.20.1

Recipe Viewer Installed

EMI

Environment

Singleplayer

Cross-Mod Interaction

No

Other Installed Mods

Monifactory

Expected Behavior

On full temperature and throttle, Large Tungstensteel Boiler produces 6400mB/t steam

Actual Behavior

Boiler displays negative production rate once it reaches over 4294mB/t, no steam made and no water drained when production rate is negative

Steps to Reproduce

  1. Build tungstensteel boiler
  2. Run boiler to temp
  3. Watch as steam production flips to negative once it reaches over 4294mB/t

Additional Information

Caused by overflow in calculation in this line: https://github.com/GregTechCEu/GregTech-Modern/blob/1.20.1/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/steam/LargeBoilerMachine.java#L120

6400 100 5 * 1000 = 3 200 000 000 > 2 147 483 647