Numismatic Overhaul

Numismatic Overhaul

2M Downloads

`java.lang.ArithmeticException: / by zero` when adding coins from mod to vanilla bundle

James103 opened this issue ยท 2 comments

commented

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:

  1. Obtain some coins
  2. Obtain a Bundle from a Wandering Trader as shown below.
  3. Attempt to put any amount of any coin inside the bundle.
  4. Game crashes
  5. Restart game and rejoin world
  6. Coins are dropped.

image

commented

Fixed in 0.1.5

commented

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