GregTechCEu Modern

GregTechCEu Modern

6M Downloads

Research Recipe Builder cannot recognize KubeJS ItemStack + resulting non-registration for custom non-research recipes

AncientShotgun opened this issue ยท 0 comments

commented

Checked for existing issues

  • I have checked for existing issues, and have found none.

Tested latest version

  • I have checked that this occurs on the latest version.

GregTech CEu Version

originally v1.6.4 but also tested under v1.7.0

Minecraft Version

1.20.1 Forge

Recipe Viewer Installed

EMI

Environment

Singleplayer

Cross-Mod Interaction

Yes

Other Installed Mods

Instance is 'Star Technology Community Edition', a modified version of Star Technology v.Zeta with Advanced AE and Extended AE added.

Expected Behavior

The following recipe registration in a file placed in kubejs/server_scripts should register an assemblyline recipe with associated scanner research recipe:

event.recipes.gtceu.assembly_line(id("n_dimensional_hypervisor"))
.itemOutputs("kubejs:n_dimensional_hypervisor")
.duration(1200)
.EUt(GTValues.VA[GTValues.ZPM])
.cleanroom(CleanroomType.CLEANROOM)
.itemInputs('gtceu:star_steel_frame')
.itemInputs('16x ae2:engineering_processor')
.itemInputs('16x advanced_ae:quantum_processor')
.itemInputs('16x #gtceu:circuits/luv')
.itemInputs('8x gtceu:quantum_eye')
.itemInputs('8x gtceu:luv_emitter')
.itemInputs('8x gtceu:luv_sensor')
.itemInputs(ChemicalHelper.get(TagPrefix.wireFine, GTMaterials.Ruridit, 16))
.itemInputs(ChemicalHelper.get(TagPrefix.plateDouble, GTMaterials.NaquadahAlloy, 6))
.inputFluids('gtceu:soldering_alloy 1152')
.inputFluids('gtceu:liquid_helium 2000')
.scannerResearch(b => b.researchStack(Item.of('ae2:quantum_link')).EUt(GTValues.VA[GTValues.IV]).duration(680));

(I have tested if the scannerResearch() call needs disambiguation; for this example it does not)

Actual Behavior

Instead, the recipe registration causes, upon world load, a nonfatal exception with the following stack trace to be logged in logs/kubejs/server.log:

[05:38:29] [ERROR] ! Error in 'ServerEvents.recipes': Research stack cannot be null or empty!
[05:38:29] [ERROR] ! java.lang.IllegalArgumentException: Research stack cannot be null or empty!
[05:38:29] [ERROR] ! at com.gregtechceu.gtceu.api.recipe.ResearchRecipeBuilder.validateResearchItem(ResearchRecipeBuilder.java:49)
[05:38:29] [ERROR] ! at com.gregtechceu.gtceu.api.recipe.ResearchRecipeBuilder$ScannerRecipeBuilder.build(ResearchRecipeBuilder.java:100)
[05:38:29] [ERROR] ! at com.gregtechceu.gtceu.integration.kjs.recipe.GTRecipeSchema$GTRecipeJS.scannerResearch(GTRecipeSchema.java:854)
[05:38:29] [ERROR] ! at com.gregtechceu.gtceu.integration.kjs.recipe.GTRecipeSchema$GTRecipeJS.scannerResearch(GTRecipeSchema.java:868)
[05:38:29] [ERROR] ! at java.lang.reflect.Method.invoke(Method.java:580)
[remainder of stack trace contains calls to internal rhino, kubejs and minecraft methods and funcs and is omitted for brevity; comment if full log is needed]

Additionally, certain recipes registered under both custom and inbuilt GTRecipeTypes will fail to register ('fail to register' means both not appearing in EMI and being unable to be processed by machines) through poorly-traceable (errors are not logged) but determinate (the same recipes fail every world load), replicable and nonfatal failure vectors.
Commenting out the erroring recipe registration resolves the exception and allows all recipes to register again.

Steps to Reproduce

  1. Place the recipe registration shown above in an appropriate ServerEvents.recipes() event callback in an arbitrarily-named .js file in kubejs/server_scripts
  2. Boot the Minecraft instance and enter a world. KubeJS will print to chat in red text, stating that server errors exist and will give the user the option to view them.

Additional Information

No response