Divide by 0 crash while interacting with PNC Aerial Interface
MuteTiefling opened this issue · 5 comments
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?
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...
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.
Hah, that would actually be amazing. I could use this to keep a specific amount of xp on me now.