lumien231 / Random-Things

The Random Things Minecraft Mod
69 stars 42 forks source link

Spectre Energy Injector says it can take more energy then it can at Integer limits. #396

Open cjm721 opened 5 years ago

cjm721 commented 5 years ago

If you ask an energy injector if it can receive Interger.MAX_VALUE it responds with it can take Integer.MAX_VALUE even though it can only store 1M.

Effectively deleting the energy. Also the energy then goes negative according to wailia.

cjm721 commented 5 years ago

Overflow appears to be happening here.

https://github.com/lumien231/Random-Things/blob/3b8d3441ef5e9f772134dae6dcaf04a6881a5132/src/main/java/lumien/randomthings/handler/spectrecoils/SpectreCoilHandler.java#L157

Questwizard commented 5 years ago

Almost definitely related to this, but I had an energy injector hooked up to a Draconic Evolution T7 energy core using a cryo-stabilized fluxduct, and this bug results in all of the energy in the core being deleted almost instantly donce the core has more than 2.147G RF in it.