Skip to content

[1.21.1] Replace "No key duration in MapLike..." with clearer error message #4325

@jurrejelle

Description

@jurrejelle

Checked for existing issues

  • I have checked for existing issues, and have found none.

Tested latest version

  • I have checked that this occurs on the latest version.

GregTech CEu Version

reab/1.21-with-love

Minecraft Version

1.21.1 NeoForge

Recipe Viewer Installed

None

Environment

Singleplayer

Cross-Mod Interaction

Yes

Other Installed Mods

dev env

Expected Behavior

When making a recipe that errors for any reason, it should clearly say that the recipe is invalid

Actual Behavior

[14:51:20] [ERROR] ! server_scripts:example.js#13: Error parsing recipe gtceu:assembler/test1 (details below this line): com.google.gson.JsonParseException: No key duration in MapLike[{"type":"gtceu:assembler","_kubejs_changed_marker":{"source":"server_scripts:example.js","line":13}}]
[14:51:20] [ERROR] ! com.google.gson.JsonParseException: No key duration in MapLike[{"type":"gtceu:assembler","_kubejs_changed_marker":{"source":"server_scripts:example.js","line":13}}]

Steps to Reproduce

ServerEvents.recipes(event => {
    event.recipes.gtceu.assembler("test1")
        .itemInputs('2x gtceu:iron_geaaaar', 'gtceu:iron_plate')
        .itemOutputs('8x minecraft:dirt')
        .circuit(11)
        .duration(50)
        .EUt(8);
})

Additional Information

It does also say above "[14:51:20] [ERROR] ! server_scripts:example.js#13: Error in 'ServerEvents.recipes': Failed to read ingredient from 2x gtceu:iron_geaaaar: Item with ID gtceu:iron_geaaaar does not exist!" so it's not the highest prio, just thought it'd be something neat to make logging more verbose

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions