Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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. #879

Open
phoenix492 opened this issue Aug 10, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@phoenix492
Copy link

phoenix492 commented Aug 10, 2024

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

@phoenix492 phoenix492 added the bug Something isn't working label Aug 10, 2024
@phoenix492 phoenix492 changed the title Attempting to remove recipes by output filter while all three of Immersive Engineering, KubeJS, and Destroy (addon for create) completely breaks and causes "java.lang.RuntimeException: Empty array?" to be thrown. 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. Aug 10, 2024
@pietro-lopes
Copy link
Contributor

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

@phoenix492
Copy link
Author

phoenix492 commented Aug 10, 2024

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.

@pietro-lopes
Copy link
Contributor

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

@phoenix492
Copy link
Author

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.

@pietro-lopes
Copy link
Contributor

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": []
}

@phoenix492
Copy link
Author

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.

@pietro-lopes
Copy link
Contributor

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

@IIIap
Copy link

IIIap commented Aug 11, 2024

ayyy, fix works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants