KubeJS Botania

KubeJS Botania

4M Downloads

[1.19.2] Issues with serialisation of mana infusion recipes, and probably petal + terra plate recipes.

Vaelzan opened this issue ยท 2 comments

commented

While working on some additional mana infusion recipes, I noticed that none of them were working (warning in KJS log is [03:51:14] [WARN ] Error creating recipe botania:kjs_6e7zdw5jceao5e7lvfy5bsgu1[botania:mana_infusion]: {"type":"botania:mana_infusion"}: java.lang.NoSuchMethodError: 'com.google.gson.JsonObject net.minecraft.world.item.ItemStack.kjs$toJson()'). Interestingly those were only logged as warnings, not errors, but that's irrelevant to the issue itself other than making it take slightly longer for me to spot. :)

Since other recipe types were working fine, I took a look at the code and seem to have found the cause & a solution, but haven't had a chance to make the changes myself to verify it.

Basically,

appears to be broken, and I suspect will work if changed to match the way it's handled here:

which is also the way KubeJS itself handles it now (for the past few months anyway) for built-in recipe types (such as shapeless crafting).

I'm guessing that PetalRecipeJS and TerraPlateRecipeJS will need to be changed too, although I haven't tested recipes using those methods yet.

commented

This is actually weird, in before I thought using kjs$toJson should be fine, but later it turned out to be not in some recipes and will need to use itemToJson. I made a fix for some of the recipes, but not the all as they didn't throw such warning in my tests.

commented

Yeah, I figured it wasn't happening on your end since it'd be pretty obvious when things aren't working. Difference in KubeJS version potentially? I haven't looked at their recent commits to see what changes have been made recently though.

Thanks for the quick fix! I'll be happy to be able to use my new alchemy + conjuration catalyst recipes! :)