KubeJS

KubeJS

61M Downloads

Attempting to remove recipes by output filter while all three of Immersive Engineering, KubeJS, and Destroy (addon for create) are installed completely breaks and causes "java.lang.RuntimeException: Empty array?" to be thrown.

phoenix492 opened this issue ยท 8 comments

commented

Minecraft Version

1.20.1

KubeJS Version

2001.6.5-build.14

Rhino Version

2002.2.2-build.18

Architectury Version

9.2.14

Forge/Fabric Version

Both NeoForge 47.1.106 and Forge 47.3.5

Describe your issue

Simply installing Immersive Engineering (Version 1.20.1-10.1.0-171, the final 1.20.1 version), Destroy(0.8), Create (dependency of Destroy, 0.5.1.f) and the above listed dependencies of KubeJS is enough for the following line of javascript to error out and break every other recipe adjustment.

ServerEvents.recipes(event => { event.remove( {output: 'minecraft:bricks'} ) } )

Here's the KubeJS server.log, but it's pretty irrelevant as the same exception shows up in the latest.log and provides no extra information.
https://gist.github.com/phoenix492/56e271a6d6e3c238bb6dfc5f94fbbddb

Crash report/logs

https://gist.github.com/phoenix492/51344e8ee44d784db9b052ed0c2c3900

commented

go to common.properties at kubejs/config
set the following:
matchJsonRecipes=false

commented

That's great, but quite frankly that's not a solution to the bug. I've got over 300 mods and thousands of recipes that aren't affected if I switch that option off that I am not going to edit by hand.

commented

removing by output, replaceInput/Output are only supported on vanilla recipes and recipes that have addons.
If you are trying to remove by output of a recipe of a mod like IE and do not have KubeJS IE installed, it will not work

commented

Respectfully, please actually read the issue or wait for someone who actually understands it to come along. It's clear you didn't even bother to read any of what was happening.

commented

This is the root of the problem.
https://github.com/BluSunrize/ImmersiveEngineering/blob/1.20.1/src/generated/resources/data/immersiveengineering/recipes/crusher/ore_fluorite.json

It is missing a condition to check on tag of the gem.

If you add this json to your kubejs/data/immersiveengineering/recipes/crusher/ore_fluorite.json it will fix

{
  "type": "immersiveengineering:crusher",
  "conditions": [
    {
      "type": "forge:not",
      "value": {
        "type": "forge:tag_empty",
        "tag": "forge:ores/fluorite"
      }
    },
        {
      "type": "forge:not",
      "value": {
        "type": "forge:tag_empty",
        "tag": "forge:gems/fluorite"
      }
    }
  ],
  "energy": 6000,
  "input": {
    "tag": "forge:ores/fluorite"
  },
  "result": {
    "base_ingredient": {
      "tag": "forge:gems/fluorite"
    },
    "count": 6
  },
  "secondaries": []
}
commented

Thank you for the fix and sorry for the snippy reply, smashing my head against this issue for a week has brought the worst out in me. I can confirm this does fix the issue, but I'll leave this open for someone else to close as a more "sane" fix may be preventing KubeJS from completely erroring out when running into a misconfiguration like this. I may also throw a quick issue report or even PR towards the Immersive Engineering team at some point. It's a huge weight to have this awful issue that's been hanging over my modpack finally killed.

commented

On KubeJS side, this issue comes from Kube trying to get the output from the mod recipe.
IE tries to resolve that tag and gives an empty array, and throws that Exception (all on IE side)

So I can say that it is 90% on IE side, maybe KubeJS can try to not crash and catch that error and move on.

Also, this is 1.20.1 version, it is very unlikely to something change as devs are focused on 1.21.1

commented

ayyy, fix works!