wisp-forest / alloy-forgery

Alloy smelter mod for Fabric
MIT License
43 stars 18 forks source link

[1.19.2] 2.0.19 breaks KubeJS recipes #98

Closed itsdinkd closed 1 year ago

itsdinkd commented 1 year ago

When updating to 2.0.19 of Alloy Forgery, my main kubejs file broke with the following error message in kubejs' error file, server.txt

https://pastebin.com/bL4hJqtv

Dragon-Seeker commented 1 year ago

Could you send the given custom recipes for alloy forgery? The log provided doesn't have much to go on besides something about the recipes having a null output.

itsdinkd commented 1 year ago

There is no custom recipe for Alloy Forgery, that's unfortunately the thing. I am not changing any recipes involving alloy in the file that's breaking. It's most likely affecting the recipes that have tags (ore) that alloy forgery is compatible with.

After talking with some in KubeJS discord, we're looking at this commit with this as possibly the reason? I have a feeling that the devs are storing null instead of Air for their Item output field in the recipe https://github.com/wisp-forest/alloy-forgery/commit/1942777a03117c7412cbd7a266b3066a2745011c#diff-9350e8f16bdbe0fdb014662a3a22c224e725349a76ea57f14ff0656f4038e737

https://github.com/wisp-forest/alloy-forgery/blob/1.19.2/src/main/java/wraith/alloyforgery/recipe/AlloyForgeRecipeSerializer.java#L74

Here is the discord convo in kubejs discord if you'd like to join https://discord.com/channels/303440391124942858/1081321614026752040/1081337880368136272

itsdinkd commented 1 year ago

I double checked also and 2.0.17 is indeed is not having any issues with the kubejs script file that breaks when using 2.0.19

Dragon-Seeker commented 1 year ago

Ah, still don't know where this is happening and why but Ill see about getting a build with a Change to fix this issue.

I need more time to figure out what is going on here before I decided on the previous action.

Noaaan commented 1 year ago

An addendum to anyone who stumbled upon this issue, you are able to bypass it by forcing KubeJS to ignore Alloy Forgery when parsing recipes. By adding a "not" condition to your recipe events, then the Alloy Forgery recipe handler is never invoked by KubeJS, and therefore it never fails. Provided example:

ServerEvents.recipes(event => {
    // helper function that always checks against alloy forgery for each recipe output removal
    let removeOutput = function(output2) {
        event.remove({output: output2, not:{mod:'alloy_forgery'}})
    }

    // sticks begone, without any errors!
    removeOutput('minecraft:stick')
...
itsdinkd commented 1 year ago

Thank you for the 1.19.2 backport fix. seeing how most modpacks are still on 1.19.2, this is truly appreciated.