Part of script is only working after a /reload
aaronhowser1 opened this issue ยท 0 comments
Minecraft Version
1.19.2
KubeJS Version
kubejs-forge-1902.6.0-build.142
Rhino Version
rhino-forge-1902.2.2-build.268
Architectury Version
architectury-6.5.85-forge
Forge/Fabric Version
Forge 43.2.14
Describe your issue
ServerEvents.recipes((recipe) => {
let replace = (original, desired) => {
recipe.replaceInput({}, original, desired)
recipe.replaceOutput({}, original, desired)
console.log('Replaced ' + original + ' in recipes with ' + desired)
}
let replaceThese = [
['prefab:block_compressed_stone', 'compressium:stone_1'],
['prefab:block_double_compressed_stone', 'compressium:stone_2'],
['prefab:block_triple_compressed_stone', 'compressium:stone_3'],
['prefab:block_compressed_dirt', 'compressium:dirt_1'],
['prefab:block_double_compressed_dirt', 'compressium:dirt_2'],
['prefab:block_triple_compressed_dirt', 'compressium:dirt_3'],
['prefab:block_compressed_obsidian', 'compressium:obsidian_1'],
['prefab:block_double_compressed_obsidian', 'compressium:obsidian_2'],
]
for (let i of replaceThese) {
replace(i[0], i[1])
}
let slabs = [
'acacia',
'birch',
'crimson',
'dark_oak',
'jungle',
'oak',
'spruce',
'warped',
'mangrove',
'blackstone',
]
for (let slab of slabs) {
recipe.shapeless(`railways:track_${slab}`, [
'create:track',
`minecraft:${slab}_slab`,
])
}
let quarkChests = [
['quark:ancient_chest', 'quark:ancient_planks'],
['quark:bamboo_chest', 'quark:bamboo_planks'],
['quark:blossom_chest', 'quark:blossom_planks'],
['quark:oak_chest', 'minecraft:oak_planks'],
['quark:spruce_chest', 'minecraft:spruce_planks'],
['quark:birch_chest', 'minecraft:birch_planks'],
['quark:jungle_chest', 'minecraft:jungle_planks'],
['quark:acacia_chest', 'minecraft:acacia_planks'],
['quark:dark_oak_chest', 'minecraft:dark_oak_planks'],
['quark:crimson_chest', 'minecraft:crimson_planks'],
['quark:warped_chest', 'minecraft:warped_planks'],
['quark:mangrove_chest', 'minecraft:mangrove_planks'],
['quark:nether_brick_chest', 'minecraft:nether_bricks'],
['quark:purpur_chest', 'minecraft:purpur_block'],
['quark:prismarine_chest', 'minecraft:prismarine'],
['quark:azalea_chest', 'quark:azalea_planks'],
]
recipe.shaped('minecraft:chest', ['PPP', 'P P', 'PPP'], {
P: '#minecraft:planks',
})
for (let i of quarkChests) {
let chest = i[0]
let ingredient = i[1]
recipe.remove({ output: chest })
recipe.shapeless(chest, ['minecraft:chest', ingredient])
}
})
This is my script. This is what the recipe for Prefab houses looks like after launching but before reloading:
This is what it looks like after reloading:
It's not ALL of the script that's not loading properly though. As seen here, the bit with the Quark Chests works absolutely fine.
Crash report/logs
https://gist.github.com/aaronhowser1/8bcbcc7884e0256c0dd17343ab0aeac1