Modular Routers

Modular Routers

33M Downloads

Divide by 0 crash while interacting with PNC Aerial Interface

MuteTiefling opened this issue · 5 comments

commented

Minecraft Version

1.16.1

Forge Version

32.0.108

Mod Version

modular-routers-1.16.1-7.0.1-29.jar

Describe your problem, including steps to reproduce it

Place router
fluid module pulling from tank into router
fluid module pushing to aerial interface

Then stick a regulator on the sending module and try to set it to 1%. It crashes out immediately

Any other comments?

crash-2020-09-18_15.11.50-server.txt

commented

Hmm, yeah. The Aerial Interface's "fluid handler" (i.e. the proxy for the player's XP) reports a max capacity of 0, causing the divide by zero exception. Maybe it should report Integer.MAX_VALUE (2^31 - 1) instead, since a player can have effectively unlimited XP. But 1% of that is still over 21,000,000 mB of XP fluid, which is an enormous quantity...

commented

Had a thought here: I could add a toggle in the Fluid Module GUI to switch between regulating by percentage or absolute amount. That's potentially useful in other situations too.

commented

Hah, that would actually be amazing. I could use this to keep a specific amount of xp on me now.

commented

Give 7.0.2 a go then :) Just approved on Curseforge.

commented

Looking pretty sweet, thanks! Got my XP nicely regulated now to a precise number of levels.