KubeJS-Mods / KubeJS

https://kubejs.com
GNU Lesser General Public License v3.0
307 stars 90 forks source link

Conditional Recipes from any mod completely break if you add or remove any recipes in Neoforge 1.20.4+ #839

Closed Saereth closed 3 months ago

Saereth commented 4 months ago

Minecraft Version

1.20.4

KubeJS Version

kubejs-neoforge-2004.7.0-build.16.jar

Rhino Version

rhino-neoforge-2004.2.3-build.4.jar

Architectury Version

architectury-11.1.17-neoforge.jar

Forge/Fabric Version

Neoforge 20.4.234

Describe your issue

1.20.4


When making a conditional recipe in a datapack, it works fine, untill you add a recipe through ServerEvents.recipes. Steps to reproduce:

All recipes with conditions are now not available anymore. My assumption is; that in Neoforge, its called "neoforge:conditions":[] and not "conditions":[]

This is very evident when testing with Sophisticated Backpacks, as that mod uses it in every recipe, basicly rendering those useless.

For testing i also used this modid_loaded recipe, which works fine if there are no recipes declared via KubeJS.

JSONRecipe:

{
    "neoforge:conditions":[
      {
        "type": "neoforge:modid_loaded",
        "modid": "kubejs"
      }
    ],
    "type": "minecraft:crafting_shaped",
    "category": "redstone",
    "key": {
        "#": {
            "item": "minecraft:oak_planks"
        }
    },
    "pattern": ["##", "##", "##"],
    "result": {
        "count": 3,
        "item": "minecraft:oak_door"
    }
}

Recipe i used to test if it would break the JSON Recipes

ServerEvents.recipes((event) => {

    event
      .shaped("minecraft:beehive", ["PPP", "SSS", "PPP"], {
        P: "#minecraft:planks",
        S: "minecraft:sugar",
      })

  });

through testing, i found out that, checkConditions in RecipeHelper is not firing correctly (my assumption is that the ICondition.conditionsMatched(ops, arr) is not working correctly).

Tazz Made a video showing it as well pretty succintly.

https://youtu.be/tvuQ93H3GS4

I know when you released the 1.20.4 you were moving on pretty immediately which is fine, I havent been able to test this to see if its still an issue on 1.20.5+ as I couldnt get kube to load up on that version presently so this may or may not continue to be a breaking issue in versions beyond 1.20.4 but I suspect it may be.

Crash report/logs

No response

MaxNeedsSnacks commented 4 months ago

My assumption is; that in Neoforge, its called "neoforge:conditions":[] and not "conditions":[] well this is... irrelevant since we did that rename early on in the 1.20.4 cycle, but idk what's wrong with conditionsMatched hmmm

MaxNeedsSnacks commented 3 months ago

I think we fixed this together a while ago, so I'm closing this issue

Saereth commented 3 months ago

yep, thanks again!