emilyploszaj / emi

A featureful and accessible item and recipe viewer
MIT License
250 stars 49 forks source link

Crash when clicking Tag Group #51

Closed quiqueck closed 2 years ago

quiqueck commented 2 years ago

When clicking the c:chees Tag Group (which might be empty), EMI crashes with the following:

16:49:05] [Render thread/ERROR]: Reported exception thrown!
net.minecraft.class_148: mouseClicked event handler
    at net.minecraft.class_437.method_25412(class_437.java:496) ~[client-intermediary.jar:?]
    at net.minecraft.class_312.method_1601(class_312.java:94) ~[client-intermediary.jar:?]
    at net.minecraft.class_312.method_22686(class_312.java:165) ~[client-intermediary.jar:?]
    at net.minecraft.class_1255.execute(class_1255.java:103) ~[client-intermediary.jar:?]
    at net.minecraft.class_312.method_22684(class_312.java:165) ~[client-intermediary.jar:?]
    at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:43) ~[lwjgl-glfw-3.3.1.jar:?]
    at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.3.1.jar:?]
    at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3403) ~[lwjgl-glfw-3.3.1.jar:?]
    at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:197) ~[client-intermediary.jar:?]
    at net.minecraft.class_1041.method_15998(class_1041.java:310) ~[client-intermediary.jar:?]
    at net.minecraft.class_310.method_1523(class_310.java:1171) ~[client-intermediary.jar:?]
    at net.minecraft.class_310.method_1514(class_310.java:734) [client-intermediary.jar:?]
    at net.minecraft.client.main.Main.main(Main.java:237) [client-intermediary.jar:?]
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461) [fabric-loader-0.14.8.jar:?]
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.14.8.jar:?]
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric-loader-0.14.8.jar:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because the return value of "java.util.Map.get(Object)" is null
    at dev.emi.emi.api.EmiApi.displayRecipes(EmiApi.java:105) ~[emi-0.3.0+1.19.jar:?]
    at dev.emi.emi.screen.EmiScreenManager.stackInteraction(EmiScreenManager.java:769) ~[emi-0.3.0+1.19.jar:?]
    at dev.emi.emi.api.widget.SlotWidget.mouseClicked(SlotWidget.java:224) ~[emi-0.3.0+1.19.jar:?]
    at dev.emi.emi.screen.RecipeScreen.method_25402(RecipeScreen.java:398) ~[emi-0.3.0+1.19.jar:?]
    at net.minecraft.class_312.method_1611(class_312.java:94) ~[client-intermediary.jar:?]
    at net.minecraft.class_437.method_25412(class_437.java:491) ~[client-intermediary.jar:?]
    ... 15 more

Before that there is also an error while loading the world (not sure if it is related):

[16:10:58] [Thread-14/INFO]: [STDERR]: [emi] [emi] Exception loading plugin provided by emi
[16:10:58] [Thread-14/INFO]: [STDERR]: java.lang.NullPointerException: Cannot invoke "net.minecraft.class_1856.method_8103()" because the return value of "net.minecraft.class_1741.method_7695()" is null
[16:10:58] [Thread-14/INFO]: [STDERR]:  at dev.emi.emi.VanillaPlugin.register(VanillaPlugin.java:288)
[16:10:58] [Thread-14/INFO]: [STDERR]:  at dev.emi.emi.EmiReloadManager$ReloadWorker.run(EmiReloadManager.java:99)
[16:10:58] [Thread-14/INFO]: [STDERR]:  at java.base/java.lang.Thread.run(Thread.java:833)
[16:10:58] [Thread-14/INFO]: [STDERR]: [emi] java.lang.NullPointerException: Cannot invoke "net.minecraft.class_1856.method_8103()" because the return value of "net.minecraft.class_1741.method_7695()" is null
    at dev.emi.emi.VanillaPlugin.register(VanillaPlugin.java:288)
    at dev.emi.emi.EmiReloadManager$ReloadWorker.run(EmiReloadManager.java:99)
    at java.base
[16:10:58] [Thread-14/INFO]: [STDERR]: [emi] java.lang.Thread.run(Thread.java:833)
emilyploszaj commented 2 years ago

How are you encountering a tag stack that's empty? What mod/recipe is this?

quiqueck commented 2 years ago

I was not sure about the empty part.

The recipe is from Croptopia Bildschirmfoto 2022-07-31 um 21 57 28

When I click the cheeses slot, the game will crash. When I dump c:cheeses-Tag I get this:

{
  "values": [
    "croptopia:cheese",
    "survivalplus:cheese"
  ],
  "replace": true
}

So it is not an empty tag. I just noticed that I get the same crash when clicking the meat icon (which is croptopia:beef_replacements:

{
  "values": [
    "minecraft:beef",
    "croptopia:tofu"
  ],
  "replace": true
}
quiqueck commented 2 years ago

Both items in the c:cheeses-Tag have recipes:

Bildschirmfoto 2022-07-31 um 22 16 52 Bildschirmfoto 2022-07-31 um 22 17 33
emilyploszaj commented 2 years ago

Fixed in 0.3.1