KubeJS (Old)

KubeJS (Old)

3M Downloads

replaceOutput bug cascading over unrelated recipes

Abalieno opened this issue ยท 6 comments

commented

Minecraft Version

1.19.2

KubeJS Version

kubejs-fabric-1902.6.0-build.121

Rhino Version

rhino-fabric-1902.2.2-build.264

Architectury Version

architectury-6.3.56-fabric

Forge/Fabric Version

fabric-api-0.67.1+1.19.2

Describe your issue

This is at least partially related to #531
As written at the bottom, it happens with single commands too.
event.replace event.replaceInput and event.replaceOutput are all broken.

All problems and scripts I'm describing here are problems seen on 1.19 only, the same scripts work on 1.18. I've also verified there are no errors or warnings in the logs, I've also checked the main ones.

The specific issue I'm pointing at here is that the command is deleting recipes that are UNRELATED to the command given.

tyjtyje

This is a default recipe in Modern Industrialization.

It's been deleted by the following line of script:
event.replaceOutput({}, "create:iron_sheet", "modern_industrialization:iron_plate")

While I don't understand the {} at the beginning (I'm only porting the scripts), this script didn't have any problem on 1.18.

But the real issue is that the assembler recipe I show above gets deleted by that line even if it doesn't share ANYTHING with it.
That recipe doesn't contain neither a "create:iron_sheet" nor "modern_industrialization:iron_plate"
The plate shown in the image is stainless steel

Crash report/logs

No response

commented

Probably related to #531
Can you please supply your latest.log?

commented

I linked to the issue myself. The logs are clean.
I was doing some reloads back and forth at the end. Only some errors related to EMI.

latest.log

commented

What is the recipes id, and type?
Also, is it just visual? (Does it still work in the machine, just stop showing in REI)

commented

modern_industrialization:electric_age/circuit/assembler/digital_circuit_board
default recipe inside jar

btw, I've added {mod: "create"} to that line
and now the recipes exist, with the correct ID, but it has replaced the items with... steel_block
it makes no sense

cannot say if it's visual, I'd have to build the whole thing to test

tyjtyuk

event.replaceOutput({mod: "create"}, "create:iron_sheet", "modern_industrialization:iron_plate")

commented

Ok, all the assemblers recipes had ingredients replaced by a steel block, but it was caused by a different line:
event.replaceInput({mod: "modern_industrialization"}, "modern_industrialization:forge_hammer", "modern_industrialization:steel_block")

Commenting it out restores all recipes as they should.

As I understand the command, it should replace the forge_hammer with the steel_block, not EVERYTHING.

MI dev on discord saying it might be a problem on their side on replaceInput implementation.

to summarize:

  • if you don't specify the mod, kubejs throws an exception, it can't replace items in recipes (1.19 bug)
  • if you don't specify the mod, but use {}, you don't get any errors, but this cause erasure of unrelated recipes (might be an incidental MI issue)
commented

This is now fixed on Modern Industrialization side:
https://github.com/AztechMC/Modern-Industrialization/releases/tag/1.4.2-beta

The original kubejs problem for the commands in the other issue still exist. I guess I'll close this one myself.