Lightman's Currency

Lightman's Currency

331k Downloads

BUG: Crash with Pneumaticcraft

agentwolf88 opened this issue ยท 3 comments

commented

Minecraft Version (REQUIRED): 1.18.2
Forge Version (REQUIRED): 1.18.2 - 40.0.17
Lightman's Currency Version (REQUIRED): lightmanscurrency-1.18.2-1.0.5.3.jar
Other Relevant Mods & Version (LC Tech, etc.): pneumaticcraft-repressurized-1.18.2-3.1.1-61.jar
Connection Type (Single-player, server/client, LAN world): Singleplayer

Describe the bug
Crash at entering world

To Reproduce
Steps to reproduce the behavior:

  1. Go to Singleplayer
  2. Click on your world
  3. wait up to 100%
  4. crash

crash-2022-03-18_12.04.52-server.txt

commented

A little more info for context (I'm the author of PneumaticCraft)...

Periodically (once per minecraft day by default), PneumaticCraft scans all villager trades and adds a random selection to its Amadron delivery system so players can order these trades for drone delivery. The trade scan is done from a ServerTickEvent so the server is fully initialized (i.e. datapacks etc. all loaded) when the scan is done.

Not sure why in this case, but your code seems to be hitting an enchantment with an invalid max enchantment level, adding 1 to that, and passing the result to Random#nextInt(), hence the crash. Don't know which enchantment or what the max level of it is, but an easy workaround here is ensure the value is > 0 before passing it to nextInt().

commented

Should be fixed in v1.0.5.5

commented

Thank you for the context, I was curious why the villager trades were being referenced outside of the village context. Should be an easy fix now that I know what's going on, and it should be fixed in the next update (although I'll make sure it logs an error noting the enchantment id if it gets an enchantment with a max level that's less than 1).