Checked for existing issues
Tested latest version
GregTech CEu Version
gtceu-1.21.1-8.0.0-SNAPSHOT+20260620-180128-b71dec5
Minecraft Version
1.21.1 NeoForge (21.1.235)
Recipe Viewer Installed
JEI
Environment
Singleplayer (also on Dedicated Server)
Cross-Mod Interaction
Yes — KubeJS 2101.7.2-build.368
Other Installed Mods
GTCEu + KubeJS + dependencies are sufficient to reproduce.
Expected Behavior
Calling .stationResearch(...) / .scannerResearch(...) on a KubeJS recipe registers the research condition (as in GTCEu 1.x).
Actual Behavior
java.lang.NullPointerException: Cannot invoke "java.util.List.stream()" because the return value of
"com.gregtechceu.gtceu.integration.kjs.recipe.GTRecipeSchema$GTKubeRecipe.getValue(dev.latvian.mods.kubejs.recipe.RecipeKey)" is null
at ...GTRecipeSchema$GTKubeRecipe.applyResearchProperty(GTRecipeSchema.java:1085)
at ...GTRecipeSchema$GTKubeRecipe.stationResearch(GTRecipeSchema.java:1150)
Steps to Reproduce
machines.enableResearch = true (default).
- Server script:
ServerEvents.recipes(event => {
event.recipes.gtceu.assembly_line('test:npe')
.itemInputs('minecraft:iron_ingot')
.itemOutputs('minecraft:gold_ingot')
.duration(100)
.EUt(30)
.stationResearch(b => b.researchStack(Item.of('minecraft:diamond')).EUt(122880).CWUt(32))
})
- NPE — unless any other condition (e.g.
.cleanroom(...)) was added before the research call.
Additional Information
Root cause: CONDITIONS is a defaultOptional() key. addCondition guards against null (if (getValue(CONDITIONS) == null) setValue(CONDITIONS, new ArrayList<>()), GTRecipeSchema.java:152), but applyResearchProperty calls this.getValue(CONDITIONS).stream() directly (line ~1085) and NPEs when no condition was added yet. Workaround: call .cleanroom(...) (or any condition) before .stationResearch(...).
Checked for existing issues
Tested latest version
GregTech CEu Version
gtceu-1.21.1-8.0.0-SNAPSHOT+20260620-180128-b71dec5Minecraft Version
1.21.1 NeoForge (21.1.235)
Recipe Viewer Installed
JEI
Environment
Singleplayer (also on Dedicated Server)
Cross-Mod Interaction
Yes — KubeJS 2101.7.2-build.368
Other Installed Mods
GTCEu + KubeJS + dependencies are sufficient to reproduce.
Expected Behavior
Calling
.stationResearch(...)/.scannerResearch(...)on a KubeJS recipe registers the research condition (as in GTCEu 1.x).Actual Behavior
Steps to Reproduce
machines.enableResearch = true(default)..cleanroom(...)) was added before the research call.Additional Information
Root cause:
CONDITIONSis adefaultOptional()key.addConditionguards against null (if (getValue(CONDITIONS) == null) setValue(CONDITIONS, new ArrayList<>()), GTRecipeSchema.java:152), butapplyResearchPropertycallsthis.getValue(CONDITIONS).stream()directly (line ~1085) and NPEs when no condition was added yet. Workaround: call.cleanroom(...)(or any condition) before.stationResearch(...).