axperty / cratedelight

A Minecraft mod that adds more crates and bags to the game, that are useful to save storage.
https://curseforge.com/minecraft/mc-mods/crate-delight-forge
Other
2 stars 3 forks source link

Log spam for unregistered items #10

Closed Partonetrain closed 1 month ago

Partonetrain commented 2 months ago

The game attempts to load recipes and loot tables for items that aren't registered, creating logspam. This can be prevented with the following JSON in your recipes/loottables:

"fabric:load_conditions": [
    {
      "condition": "fabric:all_mods_loaded",
      "values": [
        "mod_id_here"
      ]
    }
  ],

or, in the case of items that are only registered without another mod loaded:

"fabric:load_conditions": [
    {
      "condition": "fabric:not",
      "value": {
         "condition": "fabric:all_mods_loaded",
         "values": [
           "mod_id_here"
         ]
       }
    }
  ],

Logspam examples:

Parsing error loading recipe cratedelight:minecraft/crafting/beetroots
com.google.gson.JsonSyntaxException: Unknown item 'cratedelight:beetroot_crate'
    at net.minecraft.class_1869.method_17878(class_1869.java:272) ~[client-intermediary.jar:?]
    at java.util.Optional.orElseThrow(Optional.java:403) ~[?:?]
    at net.minecraft.class_1869.method_8155(class_1869.java:272) ~[client-intermediary.jar:?]
    at net.minecraft.class_1856.method_8107(class_1856.java:160) ~[client-intermediary.jar:?]
    at net.minecraft.class_1856.method_8102(class_1856.java:143) ~[client-intermediary.jar:?]
    at net.minecraft.class_1867$class_1868.method_8144(class_1867.java:107) ~[client-intermediary.jar:?]
    at net.minecraft.class_1867$class_1868.method_8142(class_1867.java:92) ~[client-intermediary.jar:?]
    at net.minecraft.class_1867$class_1868.method_8121(class_1867.java:87) ~[client-intermediary.jar:?]
    at net.minecraft.class_1863.method_17720(class_1863.java:135) ~[client-intermediary.jar:?]
    at net.minecraft.class_1863.method_20705(class_1863.java:56) ~[client-intermediary.jar:?]
    at net.minecraft.class_1863.method_18788(class_1863.java:35) ~[client-intermediary.jar:?]
    at net.minecraft.class_4080.method_18790(class_4080.java:13) ~[client-intermediary.jar:?]
    at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?]
    at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
    at net.minecraft.class_4014.method_18365(class_4014.java:69) ~[client-intermediary.jar:?]
    at net.minecraft.class_1255.method_18859(class_1255.java:156) ~[client-intermediary.jar:?]
    at net.minecraft.class_4093.method_18859(class_4093.java:23) ~[client-intermediary.jar:?]
    at net.minecraft.class_1255.method_16075(class_1255.java:130) ~[client-intermediary.jar:?]
    at net.minecraft.class_1255.method_18857(class_1255.java:139) ~[client-intermediary.jar:?]
    at net.minecraft.class_310.method_18857(class_310.java:31538) ~[client-intermediary.jar:?]
    at net.minecraft.class_7196.method_45694(class_7196.java:188) ~[client-intermediary.jar:?]
    at net.minecraft.class_7196.method_41891(class_7196.java:123) ~[client-intermediary.jar:?]
    at net.minecraft.class_7196.method_41899(class_7196.java:202) ~[client-intermediary.jar:?]
    at net.minecraft.class_7196.handler$kmk000$yeetusexperimentus$onLoadLevel(class_7196.java:1032) ~[client-intermediary.jar:?]
    at net.minecraft.class_7196.method_41894(class_7196.java) ~[client-intermediary.jar:?]
    at net.minecraft.class_528$class_4272.method_20174(class_528.java:590) ~[client-intermediary.jar:?]
    at net.minecraft.class_528$class_4272.method_20164(class_528.java:480) ~[client-intermediary.jar:?]
    at net.minecraft.class_528$class_4272.method_25402(class_528.java:402) ~[client-intermediary.jar:?]
    at net.minecraft.class_350.method_25402(class_350.java:327) ~[client-intermediary.jar:?]
    at net.minecraft.class_4069.method_25402(class_4069.java:38) ~[client-intermediary.jar:?]
    at net.minecraft.class_312.method_1611(class_312.java:98) ~[client-intermediary.jar:?]
    at net.minecraft.class_437.method_25412(class_437.java:409) ~[client-intermediary.jar:?]
    at net.minecraft.class_312.method_1601(class_312.java:98) ~[client-intermediary.jar:?]
    at net.minecraft.class_312.method_22686(class_312.java:169) ~[client-intermediary.jar:?]
    at net.minecraft.class_1255.execute(class_1255.java:102) ~[client-intermediary.jar:?]
    at net.minecraft.class_312.method_22684(class_312.java:169) ~[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.pollEvents(RenderSystem.java:201) ~[client-intermediary.jar:?]
    at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:219) ~[client-intermediary.jar:?]
    at net.minecraft.class_1041.method_15998(class_1041.java:288) ~[client-intermediary.jar:?]
    at net.minecraft.class_310.method_1523(class_310.java:1241) ~[client-intermediary.jar:?]
    at net.minecraft.class_310.method_1514(class_310.java:802) ~[client-intermediary.jar:?]
    at net.minecraft.client.main.Main.main(Main.java:250) ~[fabric-loader-0.15.11-1.20.1.jar:?]
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) ~[fabric-loader-0.15.11.jar:?]
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.15.11.jar:?]
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.15.11.jar:?]

Here FarmersDelight is loaded so beetroot crate isn't registered, so use the 2nd JSON

[20:51:21] [Worker-ResourceReload-8/ERROR]: Couldn't parse element loot_tables:cratedelight:blocks/green_berry_crate
com.google.gson.JsonSyntaxException: Expected name to be an item, was unknown string 'cratedelight:green_berry_crate'
    at net.minecraft.class_3518.method_17995(class_3518.java:145) ~[client-intermediary.jar:?]
    at java.util.Optional.orElseThrow(Optional.java:403) ~[?:?]
    at net.minecraft.class_3518.method_15256(class_3518.java:145) ~[client-intermediary.jar:?]
    at net.minecraft.class_3518.method_15288(class_3518.java:153) ~[client-intermediary.jar:?]
    at net.minecraft.class_77$class_78.method_413(class_77.java:55) ~[client-intermediary.jar:?]
    at net.minecraft.class_77$class_78.method_443(class_77.java:40) ~[client-intermediary.jar:?]
    at net.minecraft.class_85$class_90.method_441(class_85.java:151) ~[client-intermediary.jar:?]
    at net.minecraft.class_85$class_90.method_424(class_85.java:129) ~[client-intermediary.jar:?]
    at net.minecraft.class_79$class_5337.method_29319(class_79.java:86) ~[client-intermediary.jar:?]
    at net.minecraft.class_79$class_5337.method_517(class_79.java:74) ~[client-intermediary.jar:?]
    at net.minecraft.class_5330$class_5333.deserialize(class_5330.java:102) ~[client-intermediary.jar:?]
    at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:76) ~[gson-2.10.jar:?]
    at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) ~[gson-2.10.jar:?]
    at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) ~[gson-2.10.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:1214) ~[gson-2.10.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:1319) ~[gson-2.10.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:1290) ~[gson-2.10.jar:?]
    at com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.deserialize(TreeTypeAdapter.java:179) ~[gson-2.10.jar:?]
    at net.minecraft.class_3518.method_15291(class_3518.java:463) ~[client-intermediary.jar:?]
    at net.minecraft.class_3518.method_15272(class_3518.java:471) ~[client-intermediary.jar:?]
    at net.minecraft.class_55$class_57.method_358(class_55.java:173) ~[client-intermediary.jar:?]
    at net.minecraft.class_55$class_57.deserialize(class_55.java:169) ~[client-intermediary.jar:?]
    at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:76) ~[gson-2.10.jar:?]
    at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) ~[gson-2.10.jar:?]
    at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) ~[gson-2.10.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:1214) ~[gson-2.10.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:1319) ~[gson-2.10.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:1290) ~[gson-2.10.jar:?]
    at com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.deserialize(TreeTypeAdapter.java:179) ~[gson-2.10.jar:?]
    at net.minecraft.class_3518.method_15291(class_3518.java:463) ~[client-intermediary.jar:?]
    at net.minecraft.class_3518.method_15283(class_3518.java:481) ~[client-intermediary.jar:?]
    at net.minecraft.class_52$class_54.method_340(class_52.java:250) ~[client-intermediary.jar:?]
    at net.minecraft.class_52$class_54.deserialize(class_52.java:246) ~[client-intermediary.jar:?]
    at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:76) ~[gson-2.10.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:1214) ~[gson-2.10.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:1319) ~[gson-2.10.jar:?]
    at com.google.gson.Gson.fromJson(Gson.java:1261) ~[gson-2.10.jar:?]
    at net.minecraft.class_8490.method_51205(class_8490.java:64) ~[client-intermediary.jar:?]
    at net.minecraft.class_8490.method_51204(class_8490.java:48) ~[client-intermediary.jar:?]
    at net.minecraft.class_60.method_51195(class_60.java:55) ~[client-intermediary.jar:?]
    at java.util.HashMap.forEach(HashMap.java:1421) ~[?:?]
    at net.minecraft.class_60.method_51189(class_60.java:55) ~[client-intermediary.jar:?]
    at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?]
    at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[?:?]
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
    at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
    at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]

Here whatever mod adds berries isn't loaded so use the first JSON

axperty commented 2 months ago

Hi Partonetrain,

Thank you so much for this, I'll be making those changes in the code, I really appreciate it.

Have a good day, Axperty.