Theurgy

Theurgy

15M Downloads

[1.18.2][Crash] when clicking on Search in Creative

drakray opened this issue ยท 1 comments

commented

Describe the bug
Game(solo, didn't test with server) crash when trying to Search in Creative Mode

To Reproduce
Steps to reproduce the behavior:

  1. Go to Creative Mode
  2. Click on the Compass to search
  3. Wait for Crash
  4. See error

Expected behavior
To not crash when searching?

Screenshots
https://pastebin.com/E3pRPAJe

System (please complete the following information):

  • Theurgy Version: 1.1.0
  • OS: Win10x64
  • Minecraft Version: 1.18.2
  • Forge Version: 40.1.93
  • Modpack Link and Version, or list of mods: See crashlog

Additional context

Crash snippet
Description: mouseReleased event handler

java.lang.NullPointerException: Cannot invoke "net.minecraft.world.item.ItemStack.m_41720_()" because the return value of "net.minecraft.world.item.crafting.Recipe.m_8043_()" is null
	at com.klikli_dev.theurgy.item.AlchemicalSulfurItem$DistHelper.lambda$fillItemCategory$0(AlchemicalSulfurItem.java:104) ~[1-theurgy-1.18.2-1.1.0(1).jar%23123!/:1.18.2-1.1.0] {re:classloading}
	at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {re:mixin}
	at com.klikli_dev.theurgy.item.AlchemicalSulfurItem$DistHelper.fillItemCategory(AlchemicalSulfurItem.java:103) ~[1-theurgy-1.18.2-1.1.0(1).jar%23123!/:1.18.2-1.1.0] {re:classloading}
	at com.klikli_dev.theurgy.item.AlchemicalSulfurItem.m_6787_(AlchemicalSulfurItem.java:88) ~[1-theurgy-1.18.2-1.1.0(1).jar%23123!/:1.18.2-1.1.0] {re:classloading}
	at net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen.m_98630_(CreativeModeInventoryScreen.java:368) ~[client-1.18.2-20220404.173914-srg.jar%23332!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen.m_98560_(CreativeModeInventoryScreen.java:549) ~[client-1.18.2-20220404.173914-srg.jar%23332!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen.m_6348_(CreativeModeInventoryScreen.java:444) ~[client-1.18.2-20220404.173914-srg.jar%23332!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.MouseHandler.m_168078_(MouseHandler.java:96) ~[client-1.18.2-20220404.173914-srg.jar%23332!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:balm.mixins.json:MouseHandlerAccessor,pl:mixin:APP:supplementaries.mixins.json:MouseHandlerMixin,pl:mixin:APP:spyglass_improvements.mixins.json:MouseHandlerMixin,pl:mixin:APP:pollen-common.mixins.json:client.MouseHandlerMixin,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screens.Screen.m_96579_(Screen.java:528) ~[client-1.18.2-20220404.173914-srg.jar%23332!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:configured:set_background_texture_2,pl:runtimedistcleaner:A,re:computing_frames,pl:accesstransformer:B,xf:fml:configured:set_background_texture_2,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:configured:set_background_texture_2,pl:mixin:APP:nerb.mixins.json:ScreenMixin,pl:mixin:APP:balm.mixins.json:ScreenAccessor,pl:mixin:APP:kiwi.mixins.json:ScreenMixin,pl:mixin:APP:byg.mixins.json:access.client.ScreenAccess,pl:mixin:APP:patchouli_xplat.mixins.json:client.AccessorScreen,pl:mixin:APP:quark.mixins.json:client.ScreenMixin,pl:mixin:APP:lodestone.mixins.json:ScreenMixin,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.MouseHandler.m_91530_(MouseHandler.java:93) ~[client-1.18.2-20220404.173914-srg.jar%23332!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:balm.mixins.json:MouseHandlerAccessor,pl:mixin:APP:supplementaries.mixins.json:MouseHandlerMixin,pl:mixin:APP:spyglass_improvements.mixins.json:MouseHandlerMixin,pl:mixin:APP:pollen-common.mixins.json:client.MouseHandlerMixin,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.MouseHandler.m_168091_(MouseHandler.java:185) ~[client-1.18.2-20220404.173914-srg.jar%23332!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:balm.mixins.json:MouseHandlerAccessor,pl:mixin:APP:supplementaries.mixins.json:MouseHandlerMixin,pl:mixin:APP:spyglass_improvements.mixins.json:MouseHandlerMixin,pl:mixin:APP:pollen-common.mixins.json:client.MouseHandlerMixin,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.util.thread.BlockableEventLoop.execute(BlockableEventLoop.java:103) ~[client-1.18.2-20220404.173914-srg.jar%23332!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
	at net.minecraft.client.MouseHandler.m_91565_(MouseHandler.java:184) ~[client-1.18.2-20220404.173914-srg.jar%23332!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:balm.mixins.json:MouseHandlerAccessor,pl:mixin:APP:supplementaries.mixins.json:MouseHandlerMixin,pl:mixin:APP:spyglass_improvements.mixins.json:MouseHandlerMixin,pl:mixin:APP:pollen-common.mixins.json:client.MouseHandlerMixin,pl:mixin:A,pl:runtimedistcleaner:A}
	at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) ~[lwjgl-glfw-3.2.2.jar%2348!/:build 10] {}
	at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.2.2.jar%2344!/:build 10] {}
	at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) ~[lwjgl-glfw-3.2.2.jar%2348!/:build 10] {re:mixin}
commented

The underlying issue is that one of the mods has a recipe that returns null/none for the result, which should never happen in minecraft (instead, anything that does not have a result should instead return an empty itemstack/air).

I can add a check to prevent that, but it would be good to find the mod that causes this, because it might cause other issues down the line, as everything in minecraft and modded minecraft generally relies on this behaviour