
`java.lang.ArithmeticException: / by zero` when adding coins from mod to vanilla bundle
James103 opened this issue ยท 2 comments
When adding any type of Coin to a vanilla Bundle (which can be obtained from Wandering Traders with this mod installed), the game crashes with java.lang.ArithmeticException: / by zero
because the stack size of the coin (99) exceeds the vanilla stack size (64), and therefore 1 coin takes up less than one bundle slot. The only nonnegative integer less than one is zero, but anything divided by zero is undefined, hence the exception.
To reproduce:
- Obtain some coins
- Obtain a Bundle from a Wandering Trader as shown below.
- Attempt to put any amount of any coin inside the bundle.
- Game crashes
- Restart game and rejoin world
- Coins are dropped.
First of all, thank you for reporting. This is a severe problem we didn't foresee, and that I can't think of a good solution for either. I would assume for the time being the best course of action is to simply not allow coins in a bundle, given that money bags already serve that purpose. If you have any better ideas though, please tell us
Cheers