BetterEnd

BetterEnd

27M Downloads

[Bug] Datapack added infusion recipes cause the game to fail to load worlds, or crash upon making a new world.

Provismet opened this issue ยท 1 comments

commented

What happened?

Using datapacks to introduce additional infusion recipes causes an existing world to fail to load, Minecraft halts world loading and suggests loading the world in safe mode.
Under the same circumstance, attempting to create a new world crashes the client.

The infusion recipes were written using the format given in #78. The example sharpness recipe also causes this issue.

This occurs both in the live game and also in a development build of a mod that depends on BetterEnd.

BetterEnd

4.0.10

BCLib

3.0.13

Fabric API

0.87.0+1.20.1

Fabric Loader

0.14.21

Minecraft

1.20.1

Relevant log output

Log Output for the live game:
Failed to load level data or datapacks, can't proceed with server load
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Invalid catalyst ingredient for north: "betterend:enchanted_petal"
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
	at net.minecraft.class_7196.method_45694(class_7196.java:189)
	at net.minecraft.class_7196.method_41891(class_7196.java:123)
	at net.minecraft.class_7196.method_41899(class_7196.java:202)
	at net.minecraft.class_7196.method_41894(class_7196.java:64)
	at net.minecraft.class_528$class_4272.method_20174(class_528.java:590)
	at net.minecraft.class_528$class_4272.method_20164(class_528.java:480)
	at net.minecraft.class_528$class_4272.method_25402(class_528.java:402)
	at net.minecraft.class_350.method_25402(class_350.java:327)
	at net.minecraft.class_4069.method_25402(class_4069.java:38)
	at net.minecraft.class_312.method_1611(class_312.java:98)
	at net.minecraft.class_437.method_25412(class_437.java:409)
	at net.minecraft.class_312.method_1601(class_312.java:98)
	at net.minecraft.class_312.method_22686(class_312.java:169)
	at net.minecraft.class_1255.execute(class_1255.java:102)
	at net.minecraft.class_312.method_22684(class_312.java:169)
	at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:43)
	at org.lwjgl.system.JNI.invokeV(Native Method)
	at org.lwjgl.glfw.GLFW.glfwWaitEventsTimeout(GLFW.java:3474)
	at com.mojang.blaze3d.systems.RenderSystem.limitDisplayFPS(RenderSystem.java:237)
	at net.minecraft.class_310.method_1523(class_310.java:1244)
	at net.minecraft.class_310.method_1514(class_310.java:802)
	at net.minecraft.client.main.Main.main(Main.java:250)
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)


Log output when in a development build:
[00:37:58] [Render thread/WARN] (Minecraft) Failed to load level data or datapacks, can't proceed with server load
 java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Invalid catalyst ingredient for north: "betterend:enchanted_petal"
        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396) ~[?:?]
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073) ~[?:?]
        at net.minecraft.server.integrated.IntegratedServerLoader.load(IntegratedServerLoader.java:189) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v
        at net.minecraft.server.integrated.IntegratedServerLoader.createSaveLoader(IntegratedServerLoader.java:123) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20]
        at net.minecraft.server.integrated.IntegratedServerLoader.start(IntegratedServerLoader.java:202) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-
        at net.minecraft.server.integrated.IntegratedServerLoader.handler$zff000$bclib$wt_callFixerOnLoad(IntegratedServerLoader.java:546) ~[minecraft-merged-project-root-1.20.1-net.fa1.20.1+build.9-v2.jar:?]
        at net.minecraft.server.integrated.IntegratedServerLoader.start(IntegratedServerLoader.java) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.j
        at net.minecraft.client.gui.screen.world.WorldListWidget$WorldEntry.start(WorldListWidget.java:590) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build
        at net.minecraft.client.gui.screen.world.WorldListWidget$WorldEntry.play(WorldListWidget.java:480) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.
        at net.minecraft.client.gui.screen.world.WorldListWidget$WorldEntry.mouseClicked(WorldListWidget.java:407) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.        at net.minecraft.client.gui.widget.EntryListWidget.mouseClicked(EntryListWidget.java:327) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:
        at net.minecraft.client.gui.ParentElement.mouseClicked(ParentElement.java:38) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.client.Mouse.method_1611(Mouse.java:98) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen.java:409) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.client.Mouse.onMouseButton(Mouse.java:98) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.client.Mouse.method_22686(Mouse.java:169) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.util.thread.ThreadExecutor.execute(ThreadExecutor.java:102) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.client.Mouse.method_22684(Mouse.java:169) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:43) ~[lwjgl-glfw-3.3.1.jar:build 7]
        at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.3.1.jar:build 7]
        at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3403) ~[lwjgl-glfw-3.3.1.jar:build 7]
        at com.mojang.blaze3d.systems.RenderSystem.pollEvents(RenderSystem.java:201) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:212) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.client.util.Window.swapBuffers(Window.java:288) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.client.MinecraftClient.render(MinecraftClient.java:1241) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.client.MinecraftClient.run(MinecraftClient.java:802) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.client.main.Main.main(Main.java:250) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468) ~[fabric-loader-0.14.21.jar:?]
        at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.14.21.jar:?]
        at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.14.21.jar:?]
        at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) ~[dev-launch-injector-0.2.1+build.8.jar:?]
Caused by: java.lang.IllegalStateException: Invalid catalyst ingredient for north: "betterend:enchanted_petal"
        at org.betterx.betterend.recipe.builders.InfusionRecipe$Serializer.readIngredient(InfusionRecipe.java:291) ~[betterend-otd2erfL.jar:?]
        at org.betterx.betterend.recipe.builders.InfusionRecipe$Serializer.fromJson(InfusionRecipe.java:313) ~[betterend-otd2erfL.jar:?]
        at org.betterx.betterend.recipe.builders.InfusionRecipe$Serializer.read(InfusionRecipe.java:263) ~[betterend-otd2erfL.jar:?]
        at net.minecraft.recipe.RecipeManager.deserialize(RecipeManager.java:135) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.recipe.RecipeManager.apply(RecipeManager.java:56) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.recipe.RecipeManager.apply(RecipeManager.java:35) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.resource.SinglePreparationResourceReloader.method_18790(SinglePreparationResourceReloader.java:13) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_2v2.jar:?]
        at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?]
        at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
        at net.minecraft.resource.SimpleResourceReload.method_18365(SimpleResourceReload.java:69) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:
        at net.minecraft.util.thread.ThreadExecutor.executeTask(ThreadExecutor.java:156) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.util.thread.ReentrantThreadExecutor.executeTask(ReentrantThreadExecutor.java:23) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9
        at net.minecraft.util.thread.ThreadExecutor.runTask(ThreadExecutor.java:130) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.util.thread.ThreadExecutor.runTasks(ThreadExecutor.java:139) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v2.jar:?]
        at net.minecraft.server.integrated.IntegratedServerLoader.load(IntegratedServerLoader.java:188) ~[minecraft-merged-project-root-1.20.1-net.fabricmc.yarn.1_20_1.1.20.1+build.9-v
... 28 more

Crash report from a development build:
---- Minecraft Crash Report ----
// I let you down. Sorry :(

Time: 2023-08-18 01:14:48
Description: mouseClicked event handler

java.lang.IllegalStateException: Invalid catalyst ingredient for north: "betterend:enchanted_petal"
        at org.betterx.betterend.recipe.builders.InfusionRecipe$Serializer.readIngredient(InfusionRecipe.java:291)
        at org.betterx.betterend.recipe.builders.InfusionRecipe$Serializer.fromJson(InfusionRecipe.java:313)
        at org.betterx.betterend.recipe.builders.InfusionRecipe$Serializer.read(InfusionRecipe.java:263)
        at net.minecraft.recipe.RecipeManager.deserialize(RecipeManager.java:135)
        at net.minecraft.recipe.RecipeManager.apply(RecipeManager.java:56)
        at net.minecraft.recipe.RecipeManager.apply(RecipeManager.java:35)
        at net.minecraft.resource.SinglePreparationResourceReloader.method_18790(SinglePreparationResourceReloader.java:13)
        at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718)
        at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
        at net.minecraft.resource.SimpleResourceReload.method_18365(SimpleResourceReload.java:69)
        at net.minecraft.util.thread.ThreadExecutor.executeTask(ThreadExecutor.java:156)
        at net.minecraft.util.thread.ReentrantThreadExecutor.executeTask(ReentrantThreadExecutor.java:23)
        at net.minecraft.util.thread.ThreadExecutor.runTask(ThreadExecutor.java:130)
        at net.minecraft.util.thread.ThreadExecutor.runTasks(ThreadExecutor.java:139)
        at net.minecraft.client.gui.screen.world.CreateWorldScreen.create(CreateWorldScreen.java:352)
        at net.minecraft.client.gui.screen.world.SelectWorldScreen.method_19944(SelectWorldScreen.java:60)
        at net.minecraft.client.gui.widget.ButtonWidget.onPress(ButtonWidget.java:94)
        at net.minecraft.client.gui.widget.PressableWidget.onClick(PressableWidget.java:56)
        at net.minecraft.client.gui.widget.ClickableWidget.mouseClicked(ClickableWidget.java:189)
        at net.minecraft.client.gui.ParentElement.mouseClicked(ParentElement.java:38)
        at net.minecraft.client.Mouse.method_1611(Mouse.java:98)
        at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen.java:409)
        at net.minecraft.client.Mouse.onMouseButton(Mouse.java:98)
        at net.minecraft.client.Mouse.method_22686(Mouse.java:169)
        at net.minecraft.util.thread.ThreadExecutor.execute(ThreadExecutor.java:102)
        at net.minecraft.client.Mouse.method_22684(Mouse.java:169)
        at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:43)
        at org.lwjgl.system.JNI.invokeV(Native Method)
        at org.lwjgl.glfw.GLFW.glfwWaitEventsTimeout(GLFW.java:3474)
        at com.mojang.blaze3d.systems.RenderSystem.limitDisplayFPS(RenderSystem.java:237)
        at net.minecraft.client.MinecraftClient.render(MinecraftClient.java:1244)
        at net.minecraft.client.MinecraftClient.run(MinecraftClient.java:802)
        at net.minecraft.client.main.Main.main(Main.java:250)
        at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468)
        at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
        at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
        at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)

Other Mods

- EMI
- Extra Damage Enchantments
- Dual Swords
commented

Update: Upon some further investigation I have found that the recipes aren't broken, but rather that their format has changed.

For anyone who arrives here in the future looking for the infusion recipes, here is a working example I made for a modded enchantment:

{
    "type": "betterend:infusion",
    "input": {
        "item": "minecraft:book"
    },
    "result": {
        "item": "minecraft:enchanted_book",
        "nbt": "{StoredEnchantments:[{id:\"dualswords:parry\",lvl:1s}]}",
        "count": 1
    },
    "time": 300,
    "catalysts": {
        "north": {"item": "betterend:enchanted_petal"},
        "north_east": {"item": "minecraft:lapis_lazuli"},
        "east": {"item": "minecraft:gold_ingot"},
        "south_east": {"item": "minecraft:lapis_lazuli"},
        "south": {"item": "minecraft:iron_sword"},
        "south_west": {"item": "minecraft:lapis_lazuli"},
        "west": {"item": "minecraft:gold_ingot"},
        "north_west": {"item": "minecraft:lapis_lazuli"}
    }
}

The difference is that that item entry must be an object, not a string.
It would be amazing if a GitHub wiki could be made for this mod to quickly give datapack makers a guide for recipes and related things.