Applied Energistics 2

Applied Energistics 2

156M Downloads

Divide by 0 Crash

Nyxane opened this issue ยท 1 comments

commented

Describe the bug

While in the menu to request the amount to craft, you are able to type "1 / 0.0" which would crash after putting 0

How to reproduce the bug

Request a craft
Enter "1 / 0.0"

Expected behavior

For the zero to be caught and not crash the client from divide by 0

Additional details

After a bit of googling, it seems that BigDecimal.equals() doesn't take account into scale, the fix seems to be "BigDecimal.compareTo(BigDecimal.ZERO) == 0"
PR will come

Which minecraft version are you using?

1.20

On which mod loaders does it happen?

Forge

Crash log

https://pastebin.com/SPRdnSf8

commented

Fixed by #7611, thanks.