Create New Age adds energisers and support for the energisers in sequenced assembly steps. Ex: https://gitlab.com/antarcticgardens/create-new-age/-/blob/mc1.20.1/v1.2/dev/forge/src/generated/resources/data/create_new_age/recipes/sequenced_assembly/enchanted_golden_apple.json
I'm assuming as long as an intermediate sequence is a valid RecipeJS json, this should work.
console.log(
e.recipes.create
.sequenced_assembly('minecraft:stone', 'minecraft:cobbled_deepslate', [
e.recipes.createPressing('minecraft:stone', 'minecraft:stone'),
e.custom({
type: 'create_new_age:energising',
energyNeeded: 20000,
ingredients: [
{
item: 'minecraft:stone',
count: 1,
},
],
results: [
{
item: 'minecraft:stone',
count: 1,
},
],
}),
])
.transitionalItem('minecraft:stone')
.loops(1)
)
I can tell that this is resulting in the correct custom JSON because I can see in my logs:
[20:23:32] [WARN] Error parsing recipe create:kjs/elmz0havrfy39lpkztirwnlib[create:sequenced_assembly]: {"type":"create:sequenced_assembly","results":[{"item":"minecraft:stone","count":1}],"ingredient":{"item":"minecraft:cobbled_deepslate"},"sequence":[{"type":"create:pressing","results":[{"item":"minecraft:stone","count":1}],"ingredients":[{"item":"minecraft:stone"}]},{"type":"create_new_age:energising","energyNeeded":20000,"ingredients":[{"item":"minecraft:stone","count":1}],"results":[{"item":"minecraft:stone","count":1}]}],"transitionalItem":{"item":"minecraft:stone","count":1},"loops":1}: Cannot invoke "com.google.gson.JsonElement.getAsInt()" because the return value of "com.google.gson.JsonObject.get(String)" is null
If I pretty print that JSON:
{
type: 'create:sequenced_assembly',
results: [{ item: 'minecraft:stone', count: 1 }],
ingredient: { item: 'minecraft:cobbled_deepslate' },
sequence: [
{
type: 'create:pressing',
results: [{ item: 'minecraft:stone', count: 1 }],
ingredients: [{ item: 'minecraft:stone' }],
},
{
type: 'create_new_age:energising',
energyNeeded: 20000,
ingredients: [{ item: 'minecraft:stone', count: 1 }],
results: [{ item: 'minecraft:stone', count: 1 }],
},
],
transitionalItem: { item: 'minecraft:stone', count: 1 },
loops: 1,
}
This looks like a correct sequenced assembly recipe, but I think either KJS Create or KJS itself is trying to read an int from somewhere that it doesn't expect. I've looked through the source for SequencedAssemblyRecipeSchema and NestedRecipeComponent, but I don't understand enough of the surrounding context. Could someone with more experience take a look? If this is a small issue, I can probably PR it in.
