Tetra

Tetra

12M Downloads

[Bug] Crash when crafting if crafting effects are present for unloaded mods

Syrikal opened this issue ยท 2 comments

commented

Observed behaviour

If I create a crafting effect that triggers when crafting with a particular item, mousing over a material will cause the game to crash if that item is not present (such as if it's from a mod that's not loaded). Error message is given as Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.advancements.critereon.ItemPredicate.matches(net.minecraft.world.item.ItemStack)" because "this.material" is null

Expected behaviour

Game ignores crafting effects for nonexistent items

Steps to reproduce

  1. Create a crafting effect for a nonexistent item (e.g. misspell item ID, reference absent mod, etc.)
  2. Load game
  3. Open workbench
  4. Attempt to craft a module
  5. Game should crash as soon as any crafting material is moused over (presumably as Tetra tries to calculate the outcome)

Crashlog

https://gist.github.com/Syrikal/33590d762a8cb11028cfee0395820c81

Tetra version

6.1.0

mutil/mGui version

6.1.1

Forge version

1.20.1-47.2.0

Other mods

No response

commented

As we've discussed on discord the correct way would be to use conditions for loading those resources. Closing, not planned for now.

commented

@mickelus This appears to be a problem in tetra's own tetracelium addon as well :P
(when Twilight Forest isn't installed)