From ce717ad6656574a74d3bc6722c40c4d58d080d41 Mon Sep 17 00:00:00 2001 From: Victoria Fischer Date: Sun, 29 Jun 2025 14:36:19 +0200 Subject: [PATCH] rewrite the ore processing to be even less code, buff compatability for agricultural automation --- TODO.md | 2 +- config/almostunified/unify.json | 9 +- index.toml | 30 +- kubejs/server_scripts/grist/agricultural.js | 10 +- kubejs/server_scripts/grist/build.js | 10 +- kubejs/server_scripts/grist/energetic.js | 6 +- kubejs/server_scripts/grist/intelligent.js | 6 +- kubejs/server_scripts/init.js | 68 +- kubejs/server_scripts/mods/ae2.js | 91 +++ kubejs/server_scripts/mods/create.js | 6 + .../mods/create_enchantment_industry.js | 34 - kubejs/server_scripts/mods/croptopia.js | 18 + kubejs/server_scripts/mods/thermal.js | 4 + kubejs/server_scripts/mods/vinery.js | 20 + kubejs/server_scripts/ore-processing.js | 605 ++++++------------ kubejs/startup_scripts/rarities.js | 1 + pack.toml | 2 +- 17 files changed, 413 insertions(+), 509 deletions(-) delete mode 100644 kubejs/server_scripts/mods/create_enchantment_industry.js diff --git a/TODO.md b/TODO.md index c51f710..5bc80da 100644 --- a/TODO.md +++ b/TODO.md @@ -31,4 +31,4 @@ # mods todo: [x] remove coins [x] remove refined storage -[x] remove create additions \ No newline at end of file +[x] remove create additions diff --git a/config/almostunified/unify.json b/config/almostunified/unify.json index 565adf2..cbefda6 100755 --- a/config/almostunified/unify.json +++ b/config/almostunified/unify.json @@ -44,6 +44,7 @@ "forge:bread/{material}", "forge:tomato_sauces", "forge:bacon", + "forge:raw_bacon", "forge:cheeseburgers", "forge:hamburgers", "forge:string", @@ -56,7 +57,8 @@ "forge:rubber", "forge:cardboard", "forge:chocolate", - "forge:pasta" + "forge:pasta", + "forge:salad_ingredients/{material}" ], "materials": [ "aeternium", @@ -191,6 +193,7 @@ "forge:cardboard": ["dustrial_decor:cardboard", "create:cardboard"], "thermal:crafting/dies": ["ae2:silicon_press", "ae2:engineering_processor_press", "ae2:calculation_processor_press", "ae2:logic_processor_press"], "forge:ingots/andesite_alloy": ["create:andesite_alloy"], + "forge:storage_blocks/andesite_alloy": ["create:andesite_alloy_block"], "forge:rods/andesite_alloy": ["create:shaft"], "forge:gears/andesite_alloy": ["create:cogwheel"], "forge:flour/wheat": ["croptopia:flour"], @@ -205,7 +208,9 @@ "forge:storage_blocks/lapium": ["powder_power:block_lapium"], "forge:storage_blocks/gemium": ["powder_power:block_gemium"], "forge:storage_blocks/trilium": ["powder_power:block_trilium"], - "forge:storage_blocks/quadrilium": ["powder_power:block_quadrilium"] + "forge:storage_blocks/quadrilium": ["powder_power:block_quadrilium"], + "forge:limestone": ["quark:limestone", "alexcaves:limestone", "create:limestone"], + "create:stone_types/limestone": ["quark:limestone", "alexcaves:limestone"] }, "tagOwnerships": { "forge:crops/bell_pepper": ["forge:crops/bellpepper"], diff --git a/index.toml b/index.toml index 40e9532..1f82405 100644 --- a/index.toml +++ b/index.toml @@ -14,7 +14,7 @@ hash = "a60442351eb4a2fb2c74d4a7c62fd25d32faca43c0f192a1c261c13db9a71551" [[files]] file = "config/almostunified/unify.json" -hash = "fe3dba76719ae817115e2c8b6b428fe790f8724e33148b55148e6769bf4026c3" +hash = "1dce776168f1f6fc1d6db33035fb8aa71275d900f2726f0e8edd8551aa892200" [[files]] file = "config/apotheosis/adventure.cfg" @@ -555,19 +555,19 @@ hash = "a5e02c71fd92029ea204f96d071c6b25f59d03b59f65199cb24f96a1858b3ed0" [[files]] file = "kubejs/server_scripts/grist/agricultural.js" -hash = "b9952f3bf6160c133cbec0e604e56a3a9107149a52097b65777d532e4194b726" +hash = "65145ba119d067f34a207496f295c8fd63673723c9504637872f27ff0f78c566" [[files]] file = "kubejs/server_scripts/grist/build.js" -hash = "775f56a6fb7ef4a00416aaed596d6d9898dbb0febdd902de665a11ca1ec4640e" +hash = "0cf8fc13970c924bc2491d3bdc06f139786820fe02e49995264b6cec75b05107" [[files]] file = "kubejs/server_scripts/grist/energetic.js" -hash = "b89a43e5216126b188a5771f9dd45bc43d9292c9bdc92cfb6de3108d09559afc" +hash = "bfa1cb2d1ed46b921592c129fee680945f60e3f103f3f8ef38eef274c737fd29" [[files]] file = "kubejs/server_scripts/grist/intelligent.js" -hash = "99ad461391b378426f76c40d34661ed7640cc30cc356c9eb52b60e70b4da6426" +hash = "c0b4918e65c898df79ef88916448259936a7b1e0d7cee62912ecf801df804757" [[files]] file = "kubejs/server_scripts/grist/primordeal.js" @@ -579,7 +579,7 @@ hash = "0863a1d0a2d67ea44bd174fbe19642e73a3f85aae6bdeb12599e61f174079f2b" [[files]] file = "kubejs/server_scripts/init.js" -hash = "d103c3bb61fe22aa1f4ab6d866b1b0d24c47c2aa55f74018eaf460702043a66e" +hash = "a3be46580f9dbc584536293dc6e9a6b76583bb47069ae00d2af75583766f0438" [[files]] file = "kubejs/server_scripts/malloc-balance.js" @@ -587,7 +587,7 @@ hash = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" [[files]] file = "kubejs/server_scripts/mods/ae2.js" -hash = "4dacad5d914c02db31c80e40d7edab7fee89a817444e2f75858209278f9be446" +hash = "b0fe6b78daf76938f90ba1cb76f79079c26b01e6ed612b151d81a5d839b580e9" [[files]] file = "kubejs/server_scripts/mods/apotheosis.js" @@ -627,11 +627,7 @@ hash = "4717847a6d54f56ed6919a1e2c3591fc73780973708e818a563753132bc7c15e" [[files]] file = "kubejs/server_scripts/mods/create.js" -hash = "2989241678e27da372401bb66e10b412697b563b2fb8185a380dc3f62cefcd82" - -[[files]] -file = "kubejs/server_scripts/mods/create_enchantment_industry.js" -hash = "348f8ca4b328d6ef054d05914b3fffbf1b6813de776cfb44e6eac0ebd14c4c40" +hash = "37b42afa67f643e56d3ff664cf5a9413d97bbff5fe42fc6ed84ef5cf06d7e320" [[files]] file = "kubejs/server_scripts/mods/create_jetpack.js" @@ -647,7 +643,7 @@ hash = "99c87081cbcba79e032cf8c33c5bf9ff032e841da349c1fc720048711b064584" [[files]] file = "kubejs/server_scripts/mods/croptopia.js" -hash = "26d4be6f4fdd3b276c214eaef8e467ecf12c8a25f61e0d4c30d08e6e395b4e66" +hash = "7d09c5eec356309a58d915dbe77e901e4c72679eae95657a5c0dd371b9c9e747" [[files]] file = "kubejs/server_scripts/mods/darkutils.js" @@ -735,7 +731,7 @@ hash = "d37bfb9bc41aa46d0aa075dbe19a5eeb947b4ea3d8f13c03ac370cb00763d7a1" [[files]] file = "kubejs/server_scripts/mods/thermal.js" -hash = "b81ffc5905fe81de8d66015b0814714a8db8ecb6a4a2d927e600b328665c617a" +hash = "181bca8e5f6daabd6b42090276f48b823afec2fae37f0f3317fd76f9456a5c4e" [[files]] file = "kubejs/server_scripts/mods/torchmaster.js" @@ -743,7 +739,7 @@ hash = "9eed24eaac1d6016fc1d99bcb7259900e430afd674db47c52df89e5cdb6e1317" [[files]] file = "kubejs/server_scripts/mods/vinery.js" -hash = "208d9d49c612c84f57ee509ec02d4c44145b673caaa06fe451340dc30b8da5aa" +hash = "b24325803c78a586a2516a593456c43156b4e7b5d63a9388a3d7476fe06f5417" [[files]] file = "kubejs/server_scripts/mods/waystones.js" @@ -755,7 +751,7 @@ hash = "4003082f31011049402ff31504a6db0f4fdd6c7076167109c66fa412286be462" [[files]] file = "kubejs/server_scripts/ore-processing.js" -hash = "bb085e326aa85a8c8e86aac25f1a2a2c7fe53ebacb74d5de44b34769c73dc3e1" +hash = "d6b083214ed67a511b60348e7955c69513ca9380b1aee351a47301eeef28ff60" [[files]] file = "kubejs/server_scripts/progression/report.js" @@ -787,7 +783,7 @@ hash = "eda5964bf26b3ea17ab806944e79c16007e525da8f3ba4d6222dcbb0437f9f90" [[files]] file = "kubejs/startup_scripts/rarities.js" -hash = "1d53f63b8caab6f49d80b953546eb12a85af70a549e7e6f9cdacfa27d76e8609" +hash = "c41670ee6003d8151508fe9a35931a42765390a126fc4c9afb285edffa153892" [[files]] file = "mods/ae2-things-forge.pw.toml" diff --git a/kubejs/server_scripts/grist/agricultural.js b/kubejs/server_scripts/grist/agricultural.js index 9a7c027..996990e 100755 --- a/kubejs/server_scripts/grist/agricultural.js +++ b/kubejs/server_scripts/grist/agricultural.js @@ -120,10 +120,10 @@ ServerEvents.recipes(event => { ingredients: [ {item: 'kubejs:grist_primordeal_improved_block'}, {tag: 'kubejs:grist/agricultural/improved'}, - {item: 'kubejs:grist_primordeal_improved_block'}, - {tag: 'kubejs:grist/agricultural/improved'}, + {tag: 'forge:tomato_sauces'}, + {item: 'minecraft:rotten_flesh'}, ], - result: {item: 'kubejs:grist_agricultural_improved', count: 4} + result: {item: 'kubejs:grist_agricultural_improved_block'} }); event.custom({ type: 'farmersdelight:cooking', @@ -137,7 +137,7 @@ ServerEvents.recipes(event => { {item: 'kubejs:grist_chutney'}, {item: 'kubejs:grist_chutney'}, ], - result: {item: 'kubejs:grist_agricultural_improved'} + result: {item: 'kubejs:grist_agricultural_improved_block', count: 3} }); event.shaped('kubejs:grist_treats', [ 'AAA', @@ -176,7 +176,7 @@ ServerEvents.recipes(event => { {item: 'candlelight:pasta_bolognese'}, {item: 'collectorsreap:prawn_po_boy'}, ], - inputFluid: "{Amount:5000,FluidName:\"kubejs:grist_agricultural_improved_fluid\"}", + inputFluid: "{Amount:5000,FluidName:\"kubejs:grist_agricultural_basic_fluid\"}", output: { count: 1, item: 'kubejs:grist_morsels' diff --git a/kubejs/server_scripts/grist/build.js b/kubejs/server_scripts/grist/build.js index 649dfd0..09c1531 100755 --- a/kubejs/server_scripts/grist/build.js +++ b/kubejs/server_scripts/grist/build.js @@ -101,13 +101,17 @@ ServerEvents.recipes(event => { result: [{item: 'kubejs:reinforced_grist_ingot'}] }); - event.custom({ + /*event.custom({ type: "thermal:centrifuge", ingredients: [ { item: 'kubejs:reinforced_grist_blend' }, ], - result: [{item: 'kubejs:reinforced_grist_nugget', chance: 0.3}] - }); + result: [{item: 'kubejs:build_grist_basic'}, {item: 'kubejs:reinforced_grist_nugget', chance: 0.3}] + });*/ + event.recipes.thermal.centrifuge([ + '8x kubejs:build_grist_basic', + Item.of('kubejs:reinforced_grist_nugget').withChance(0.3) + ], 'kubejs:reinforced_grist_blend'); event.recipes.thermal.smelter( 'kubejs:reinforced_grist_blend', diff --git a/kubejs/server_scripts/grist/energetic.js b/kubejs/server_scripts/grist/energetic.js index 61d1bfb..9a7ed4a 100755 --- a/kubejs/server_scripts/grist/energetic.js +++ b/kubejs/server_scripts/grist/energetic.js @@ -55,11 +55,9 @@ ServerEvents.recipes(event => { blazing crystals require blaze powder plus either infused grist capacitors or improved grist */ event.recipes.powah.energizing([ - 'kubejs:grist_energetic_improved', 'kubejs:grist_energetic_improved', 'kubejs:grist_primordeal_improved_block', - 'kubejs:grist_primordeal_improved_block', - ], '4x kubejs:grist_energetic_improved', + ], 'kubejs:grist_energetic_improved_block', 20000 ); event.recipes.powah.energizing([ @@ -97,7 +95,7 @@ ServerEvents.recipes(event => { 'kubejs:unstable_grist_capacitor', 'kubejs:unstable_grist_capacitor', 'kubejs:unstable_grist_capacitor', - ], 'kubejs:grist_energetic_improved', + ], '3x kubejs:grist_energetic_improved_block', 50000 ); diff --git a/kubejs/server_scripts/grist/intelligent.js b/kubejs/server_scripts/grist/intelligent.js index 7bdb13e..19693bb 100755 --- a/kubejs/server_scripts/grist/intelligent.js +++ b/kubejs/server_scripts/grist/intelligent.js @@ -32,7 +32,7 @@ ServerEvents.recipes(event => { quanta: 25, arcana: -1 }, - result: Item.of('kubejs:grist_intelligent_basic_block', 2).toJson() + result: Item.of('kubejs:grist_intelligent_basic_block', 3).toJson() }); event.shaped('kubejs:sacred_flesh', [ @@ -102,8 +102,8 @@ ServerEvents.recipes(event => { catalysts come from source gems crystalized with basic intelligent fluid and sacred flesh */ event.recipes.summoningrituals.altar("kubejs:grist_primordeal_improved") - .itemOutput(Item.of('kubejs:grist_intelligent_improved_block')) - .input(Item.of('kubejs:grist_primordeal_improved_block', 2)) + .itemOutput(Item.of('kubejs:grist_intelligent_improved_block', 3)) + .input(Item.of('kubejs:grist_primordeal_improved_block', 1)) .input(Item.of('kubejs:grist_intelligent_improved', 1)) .blockBelow('ars_nouveau:arcane_core'); diff --git a/kubejs/server_scripts/init.js b/kubejs/server_scripts/init.js index fd9227d..e95d577 100755 --- a/kubejs/server_scripts/init.js +++ b/kubejs/server_scripts/init.js @@ -1,40 +1,64 @@ // priority: 0 +function Metal(name) { + this.name = name; +} -global.metalForm = (metal, tag, form, qty) => { - if (qty == undefined) { - qty = 1; - } - let itemType = AlmostUnified.getPreferredItemForTag(`forge:${tag}/${metal}`); +Metal.of = function(name) { + return new Metal(name); +} + +Metal.prototype.formOf = function(form) { + let itemType = AlmostUnified.getPreferredItemForTag(`forge:${form}/${this.name}`); if (itemType.id == 'minecraft:air') { - console.log(`metals: ${metal} ${form} has unknown tag forge:${tag}/${metal}?`) - let ret = Item.of(`alltheores:${metal}_${form}`); - if (ret.id == "minecraft:air") { - return Item.of(`thermal:${metal}_${form}`); - } - return ret; + console.warn(`metals: #forge:${form}/${this.name} is not supported by AlmostUnified! Trying a vanilla hack...`); + itemType = Ingredient.of(`#forge:${form}/${this.name}`).getFirst(); + } + if (itemType.id == 'minecraft:air') { + console.warn(`metals: No metal items found in #forge:${form}/${this.name}`) + } else { + console.log(`metals: Found ${itemType.id} for #forge:${form}/${this.name}`); } - console.log(`metals: forge:${tag}/${metal} found`); return itemType; } -global.dustItem = (material, qty) => { - return global.metalForm(material, 'dusts', 'dust', qty); +// Format is [property name, tag name] +const forms = [ + ['ingot', 'ingots'], + ['gear', 'gears'], + ['rod', 'rods'], + ['nugget', 'nuggets'], + ['plate', 'plates'], + ['dust', 'dusts'] +]; + +for (const [prop_name, form_tag] of forms) { + Metal.prototype[prop_name] = function() { + return this.formOf(form_tag); + } } -global.ingotItem = (material, qty) => { - return global.metalForm(material, 'ingots', 'ingot', qty); +global.metalForm = (metal, tag) => { + return (new Metal(metal)).formOf(tag); } -global.plateItem = (material, qty) => { - return global.metalForm(material, 'plates', 'plate', qty); +global.dustItem = (material) => { + return global.metalForm(material, 'dusts'); } -global.gearItem = (material, qty) => { - return global.metalForm(material, 'gears', 'gear', qty); +global.ingotItem = (material) => { + return global.metalForm(material, 'ingots'); } -global.nuggetItem = (material, qty) => { - return global.metalForm(material, 'nuggets', 'nugget', qty); +global.plateItem = (material) => { + return global.metalForm(material, 'plates'); +} + +global.gearItem = (material) => { + return global.metalForm(material, 'gears'); +} + +global.nuggetItem = (material) => { + return global.metalForm(material, 'nuggets'); } global.replaceInputs = (evt, filter, replaceMap) => { diff --git a/kubejs/server_scripts/mods/ae2.js b/kubejs/server_scripts/mods/ae2.js index 5cb235e..83dd0a2 100755 --- a/kubejs/server_scripts/mods/ae2.js +++ b/kubejs/server_scripts/mods/ae2.js @@ -137,4 +137,95 @@ ServerEvents.recipes(event => { 'minecraft:netherite_ingot', '#kubejs:grist/intelligent/radiant' ); + + // Nerf the storage components a little bit + event.replaceInput( + {output: 'ae2:cell_component_1k'}, + 'minecraft:redstone', + '#kubejs:grist/intelligent/basic' + ); + event.replaceInput( + {output: 'ae2:cell_component_4k'}, + 'minecraft:redstone', + '#kubejs:grist/intelligent/basic' + ); + event.replaceInput( + {output: 'ae2:cell_component_16k'}, + 'minecraft:glowstone', + '#kubejs:grist/intelligent/basic/block' + ); + event.replaceInput( + {output: 'ae2:cell_component_64k'}, + 'minecraft:glowstone', + '#kubejs:grist/intelligent/improved' + ); + event.replaceInput( + {output: 'ae2:cell_component_256k'}, + 'ae2:quartz_glass', + '#kubejs:grist/intelligent/improved/block' + ); + + // Spatial IO is gated behind radiant build grist + event.replaceInput( + {output: 'ae2:spatial_cell_component_2'}, + 'minecraft:glowstone_dust', + '#kubejs:grist/build/radiant' + ); + event.replaceInput( + {output: 'ae2:spatial_cell_component_16'}, + 'minecraft:glowstone_dust', + '#kubejs:grist/build/radiant' + ); + event.replaceInput( + {output: 'ae2:spatial_cell_component_128'}, + 'minecraft:glowstone_dust', + '#kubejs:grist/build/radiant' + ); + + // Item cells should require build grist + event.replaceInput( + {output: 'ae2:item_cell_housing'}, + 'minecraft:redstone', + '#kubejs:grist/build/basic' + ); + event.replaceInput( + {output: 'ae2:item_cell_housing'}, + 'minecraft:iron_ingot', + '#forge:plates/invar' + ); + + event.replaceInput( + {output: 'ae2:basic_card'}, + 'minecraft:iron_ingot', + '#forge:plates/silver' + ); + + event.replaceInput( + {output: 'ae2:basic_card'}, + 'minecraft:gold_ingot', + '#forge:plates/gold' + ); + + event.replaceInput( + {output: 'ae2:basic_card'}, + 'minecraft:redstone', + '#kubejs:grist/intelligent/basic' + ); + + // Advanced card is an upgrade from the basic card + event.replaceInput( + {output: 'ae2:advanced_card'}, + 'minecraft:redstone', + 'ae2:basic_card' + ); + event.replaceInput( + {output: 'ae2:advanced_card'}, + 'minecraft:iron_ingot', + '#forge:plates/invar' + ); + event.replaceInput( + {output: 'ae2:advanced_card'}, + 'minecraft:diamond', + '#kubejs:grist/intelligent/basic/block' + ); }); \ No newline at end of file diff --git a/kubejs/server_scripts/mods/create.js b/kubejs/server_scripts/mods/create.js index 531ef05..1afff63 100644 --- a/kubejs/server_scripts/mods/create.js +++ b/kubejs/server_scripts/mods/create.js @@ -103,4 +103,10 @@ ServerEvents.recipes(event => { 'B': 'create:item_vault', 'C': '#kubejs:grist/intelligent/basic', }); + + // Gate the symmetry wand behind build grist + event.replaceInput({output: 'create:wand_of_symmetry'}, + '#forge:ender_pearls', + '#kubejs:grist/build/improved' + ); }); \ No newline at end of file diff --git a/kubejs/server_scripts/mods/create_enchantment_industry.js b/kubejs/server_scripts/mods/create_enchantment_industry.js deleted file mode 100644 index 2a89570..0000000 --- a/kubejs/server_scripts/mods/create_enchantment_industry.js +++ /dev/null @@ -1,34 +0,0 @@ -ServerEvents.recipes(event => { - event.remove({output: 'create_enchantment_industry:disenchanter'}); - event.remove({output: 'create_enchantment_industry:printer'}); - - event.recipes.ars_nouveau.enchanting_apparatus( - [ - 'create:item_drain', - '#kubejs:grist/intelligent/improved' - ], - 'create_enchantment_industry:disenchanter' - ); - - event.recipes.ars_nouveau.enchanting_apparatus( - [ - '#kubejs:grist/intelligent/improved', - '#kubejs:grist/build/improved' - ], - 'create:item_drain', - 'create_enchantment_industry:disenchanter', - 2000 - ); - - event.recipes.ars_nouveau.enchanting_apparatus( - [ - '#kubejs:grist/intelligent/improved', - '#kubejs:grist/build/improved', - 'minecraft:book', - 'minecraft:book' - ], - 'create:spout', - 'create_enchantment_industry:printer', - 2000 - ); -}); \ No newline at end of file diff --git a/kubejs/server_scripts/mods/croptopia.js b/kubejs/server_scripts/mods/croptopia.js index 3fdc5f1..9b514b8 100755 --- a/kubejs/server_scripts/mods/croptopia.js +++ b/kubejs/server_scripts/mods/croptopia.js @@ -33,4 +33,22 @@ ServerEvents.recipes(event => { '#forge:tomato_sauces' ); }); + + // There is a recipe that uses the skillet, but very different ingredients + event.remove({id: 'croptopia:cheeseburger'}); + + // Allow the apple pie to be automated in create, and use other eggs + event.replaceInput({output: 'croptopia:apple_pie'}, + 'minecraft:egg', + '#forge:eggs' + ); + event.recipes.create.mixing( + 'croptopia:apple_pie', [ + 'minecraft:apple', + 'minecraft:sugar', + '#forge:eggs', + '#forge:flour', + '#forge:dough' + ] + ).heated(); }); \ No newline at end of file diff --git a/kubejs/server_scripts/mods/thermal.js b/kubejs/server_scripts/mods/thermal.js index 52acbd0..3a552e1 100755 --- a/kubejs/server_scripts/mods/thermal.js +++ b/kubejs/server_scripts/mods/thermal.js @@ -1,5 +1,9 @@ ServerEvents.recipes(event => { + // Completely remove the thermal cheese wheel, it gets confusing + event.remove({output: 'thermal:cheese_wheel'}); + event.remove({input: 'thermal:cheese_wheel'}); + // Sawdust for energy, of course. event.recipes.thermal.stirling_fuel('thermal:sawdust').energy(500) diff --git a/kubejs/server_scripts/mods/vinery.js b/kubejs/server_scripts/mods/vinery.js index 75cdad8..33c401b 100755 --- a/kubejs/server_scripts/mods/vinery.js +++ b/kubejs/server_scripts/mods/vinery.js @@ -13,4 +13,24 @@ ServerEvents.recipes(event => { let _nv = ['crimson', 'warped'].forEach(variety => { makeJuice(`${variety}_grapejuice`, `${variety}_grape`, `${variety}_grape_seeds`); }); + + event.replaceInput({output: 'candlelight:tomato_soup'}, + '#forge:tomatoes', + '#forge:tomato_sauces' + ); + event.recipes.create.mixing('candlelight:tomato_soup', [ + '#forge:tomato_sauces', + 'minecraft:sugar', + '#candellight:all_effects' + ]).heated(); + event.recipes.create.mixing('candlelight:tomato_soup', [ + Fluid.of('create_central_kitchen:tomato_sauce', 250), + 'minecraft:sugar', + '#candlelight:all_effects' + ]).heated(); + event.recipes.create.mixing('candlelight:bolognese', [ + '#candlelight:red_effect', + '#forge:cooked_beef', + 'candlelight:tomato_soup' + ]).heated(); }); \ No newline at end of file diff --git a/kubejs/server_scripts/ore-processing.js b/kubejs/server_scripts/ore-processing.js index b83616a..31f6f92 100755 --- a/kubejs/server_scripts/ore-processing.js +++ b/kubejs/server_scripts/ore-processing.js @@ -1,3 +1,4 @@ +// FIXME: Cannot process alltheores:raw_nickel ServerEvents.recipes(event => { // Metal tiers: // Copper, iron, tin, nickel, gold, zinc, brass, invar, bronze - Pre-basic build tier, the only ores that don't require a pulverizer or smelter to process @@ -13,20 +14,54 @@ ServerEvents.recipes(event => { // invar, gold, silver, electrum, signalum, lead, steel - Gated behind gear die // lumium, enderium, other alloys - Gated behind heavy duty gear die - let metalForm = (metal, tag, form) => { - let itemType = AlmostUnified.getPreferredItemForTag(`forge:${tag}/${metal}`); - if (itemType.id == 'minecraft:air') { - console.log(`metals: ${metal} ${form} has unknown tag forge:${tag}/${metal}?`) - let ret = Item.of(`alltheores:${metal}_${form}`); - if (ret.id == "minecraft:air") { - return Item.of(`thermal:${metal}_${form}`); + let rawForms = (metal) => { + let ret = null; + AlmostUnified.getItemIds(`forge:raw_materials/${metal}`).forEach(id => { + if (ret == null) { + ret = Ingredient.of(id); + } else { + ret = ret.or(id); } - return ret; - } - console.log(`metals: forge:${tag}/${metal} found`); - return itemType; + }); + return ret; } + let metalForm = global.metalForm; + + let alloyIngredients = (forms, ingredients) => { + let real_ingredients = []; + for (const ingredient of ingredients.slice(1)) { + let real_item = Item.of(ingredient); + if (real_item.id == 'minecraft:air') { + let real_ingredient = null; + for (const form of forms) { + let parts = ingredient.split(' '); + if (parts.length == 1) { + real_item = metalForm(parts[0], form); + } else { + real_item = metalForm(parts[1], form).withCount(parts[0].split('x')[0]); + } + if (real_item.id == 'minecraft:air') { + console.error(`Unknown or invalid alloy ${form} ingredient: ${ingredient}`); + } else { + if (real_ingredient == null) { + real_ingredient = Ingredient.of(real_item); + } else { + real_ingredient = real_ingredient.or(real_item); + } + //real_ingredients.push(real_item); + } + } + //console.error(`Ingredients: ${real_ingredients}`); + //real_ingredients.push(Ingredient.apply(null, real_ingredients)); + real_ingredients.push(real_ingredient); + } else { + real_ingredients.push(real_item); + } + } + return real_ingredients; + }; + // Progression // Vanilla age -> Ore hammer for crushing tin to make andesite alloy // Andesite age -> Mixer from andesite allow allows creating early alloys: bronze, brass, invar, constantan @@ -98,7 +133,6 @@ ServerEvents.recipes(event => { }, // Andesite age: Iron pickaxe to mine, crushing wheels to crush, then the crushed ore is smelted normally. Alloys require the create mixer. Ore washing to double crushed ore is unlocked, but fans require invar instead of iron. Gears can be crafted on a crafting table andesite: { - silver: [], aluminum: [], lead: [], rose_gold: [2, 'copper', 'gold'], @@ -108,6 +142,7 @@ ServerEvents.recipes(event => { }, // Mechanical/grist age: Ores require diamond pick, crushed in the pulverizer, and crushed ore is smelted normally. Alloys require the induction furnace. 4x ore centrifuge is unlocked after creating a constantan gear on the crafting table. Other gears require the press. mechanical: { + silver: [], nickel: [], invar: [3, '2x iron', 'nickel'], electrum: [2, 'gold', 'silver'], @@ -140,9 +175,12 @@ ServerEvents.recipes(event => { }; // Basic rules for all materials - for (const [key, metals] of Object.entries(progression)) { + for (const [tier, metals] of Object.entries(progression)) { for (const [metal, ingredients] of Object.entries(metals)) { + console.log(`Running ore processing for ${metal}...`); + let rawType = metalForm(metal, 'raw_materials', 'ore'); + let rawIngredients = rawForms(metal); let crushedType = Item.of(`create:crushed_raw_${metal}`); let dustType = metalForm(metal, 'dusts', 'dust'); @@ -155,8 +193,6 @@ ServerEvents.recipes(event => { let gearType = metalForm(metal, 'gears', 'gear'); let rodType = metalForm(metal, 'rods', 'rod'); - console.log(`Wiping out stock ore processing for ${metal}...`); - // Wipe out all the stock recipes event.remove({output: gearType}); event.remove({output: dustType}); @@ -168,93 +204,105 @@ ServerEvents.recipes(event => { event.remove({output: nuggetType}); event.remove({output: crushedType}); event.remove({input: crushedType}); + console.warn(`Removing ${metal} ingot recipes for ${ingotType.id}`); - // All dusts and crushed ores can be smelted to ingots, and dusts can be created from crushing ingots + let ingotSources = []; + + // All forms can be crushed back into dust if (dustType.id != 'minecraft:air') { - event.smelting(ingotType, dustType); - event.shapeless(dustType, [ingotType, '#alltheores:ore_hammers']); - event.recipes.create.crushing(dustType, ingotType); - event.recipes.create.milling(dustType, ingotType); + let dustSource = null; + [gearType, rodType, plateType, ingotType].forEach(form => { + if (form.id != 'minecraft:air') { + if (dustSource == null) { + dustSource = Ingredient.of(form); + } else { + dustSource = dustSource.or(form); + } + } + }); + + event.shapeless(dustType, [dustSource, '#alltheores:ore_hammers']); + event.recipes.create.crushing(dustType, dustSource); + event.recipes.create.milling(dustType, dustSource); + event.recipes.thermal.pulverizer(dustType, dustSource); } - // Plates can always be smelted back into their original ingot, and crushed back into dust + // All forms, including crushed ores, can be smelted back into an ingot + if (ingotType.id != 'minecraft:air') { + let ingotSource = null; + [gearType, rodType, plateType, dustType, crushedType].forEach(form => { + if (form.id != 'minecraft:air') { + if (ingotSource == null) { + ingotSource = Ingredient.of(form); + } else { + ingotSource = ingotSource.or(form); + } + } + }); + if (ingotSource != null) { + event.smelting(ingotType, ingotSource); + } else { + console.error(`Unable to generate ${metal} ingot smelting from derivatives`); + } + } + + // Gears and ingots can be pressed into a plate if (plateType.id != 'minecraft:air') { - event.smelting(ingotType, plateType); - // 1 plate = 1 ingot in presses - event.recipes.thermal.press(plateType, [ingotType]); - event.recipes.create.pressing([plateType], [ingotType]); - event.recipes.create.crushing(dustType, plateType); - event.recipes.create.milling(dustType, plateType); - event.recipes.thermal.pulverizer(dustType, plateType); - } - - // Gears can also be crushed back into dust - if (gearType.id != 'minecraft:air') { - event.recipes.create.crushing(dustType, gearType); - event.recipes.create.milling(dustType, gearType); - event.recipes.thermal.pulverizer(dustType, gearType); - } - - // Same for rods - if (rodType.id != 'minecraft:air') { - event.recipes.create.crushing(dustType, rodType); - event.recipes.create.milling(dustType, rodType); - event.recipes.thermal.pulverizer(dustType, rodType); + let plateSource = null; + [gearType, ingotType].forEach(form => { + if (form.id != 'minecraft:air') { + if (plateSource == null) { + plateSource = Ingredient.of(form); + } else { + plateSource = plateSource.or(form); + } + } + }) + event.recipes.thermal.press(plateType, plateSource); + event.recipes.create.pressing(plateType, plateSource); } // 4 ingots = 1 gear in the press if (gearType.id != 'minecraft:air') { - event.recipes.thermal.press(gearType, [ingotType.withCount(4), 'thermal:press_gear_die']); + event.recipes.thermal.press(gearType, [ingotType.withCount(4), 'thermal:press_gear_die']).id(`kubejs:${metal}_gear_in_thermal_press`); } // 9 Nuggets == 1 ingot, for every material if (nuggetType.id != 'minecraft:air') { - event.shapeless(ingotType, [nuggetType.withCount(9)]); - event.shapeless(nuggetType.withCount(9), [ingotType]); + event.shapeless(ingotType, [nuggetType.withCount(9)]).id(`kubejs:${metal}_ingot_from_nuggets`); + event.shapeless(nuggetType.withCount(9), [ingotType]).id(`kubejs:${metal}_nuggets_from_ingot`); + event.recipes.thermal.press(ingotType, [nuggetType.withCount(9), 'thermal:press_packing_3x3_die']).id(`kubejs:${metal}_ingot_from_nuggets_in_thermal_press`); + event.recipes.thermal.press(nuggetType.withCount(9), [ingotType, 'thermal:press_unpacking_die']).id(`kubejs:${metal}_nuggets_from_ingot_in_thermal_press`); } // 9 ore = 1 ore block - if (rawType.id != 'minecraft:air') { - event.shapeless(rawBlockType, [rawType.withCount(9)]); - event.shapeless(rawType.withCount(9), [rawBlockType]); + if (rawIngredients != null) { + event.shapeless(rawBlockType, [rawIngredients.withCount(9)]).id(`kubejs:${metal}_ore_block_from_ore`); + event.shapeless(rawType.withCount(9), [rawBlockType]).id(`kubejs:${metal}_ore_from_ore_block`); + event.recipes.thermal.press(rawBlockType, [rawIngredients.withCount(9), 'thermal:press_packing_3x3_die']).id(`kubejs:${metal}_ore_block_from_ore_in_thermal_press`); + event.recipes.thermal.press(rawType.withCount(9), [rawBlockType, 'thermal:press_unpacking_die']).id(`kubejs:${metal}_ore_from_ore_block_in_thermal_press`); } // 9 ingots = 1 block if (blockType.id != 'minecraft:air') { - event.shapeless(blockType, [ingotType.withCount(9)]); - event.shapeless(ingotType.withCount(9), [blockType]); + event.shapeless(blockType, [ingotType.withCount(9)]).id(`kubejs:${metal}_block_from_ingots`); + event.shapeless(ingotType.withCount(9), [blockType]).id(`kubejs:${metal}_ingots_from_block`); + event.recipes.thermal.press(blockType, [ingotType.withCount(9), 'thermal:press_packing_3x3_die']).id(`kubejs:${metal}_block_from_ingots_in_thermal_press`); + event.recipes.thermal.press(ingotType.withCount(9), [blockType, 'thermal:press_unpacking_die']).id(`kubejs:${metal}_ingots_from_block_in_thermal_press`); } // All alloys can be created in the thermal smelter, or a superheated create mixer if (ingredients.length > 0) { - for (const form of ['ingots', 'dusts']) { - let real_ingredients = []; - for (const ingredient of ingredients.slice(1)) { - let real_item = Item.of(ingredient); - if (real_item.id == 'minecraft:air') { - let parts = ingredient.split(' '); - if (parts.length == 1) { - real_item = metalForm(parts[0], form); - } else { - real_item = metalForm(parts[1], form).withCount(parts[0].split('x')[0]); - } - } + let real_ingredients = alloyIngredients(['ingots', 'dusts'], ingredients); - if (real_item.id == 'minecraft:air') { - console.error(`Unknown or invalid ${metal} alloy ingredient: ${ingredient}`); - } - real_ingredients.push(real_item); - } - - if (real_ingredients.length == 0) { - console.error(`Unable to create ingots from ${form} for ${metal}!`); + if (real_ingredients.length == 0) { + console.error(`Unable to create ingots from ${form} for ${metal}!`); + } else { + // If we have 3 or fewer ingredients, we can create it in the 3-slot thermal smelter + if (real_ingredients.length <= 3) { + event.recipes.thermal.smelter(ingotType.withCount(ingredients[0]), real_ingredients); + event.recipes.create.mixing(ingotType.withCount(ingredients[0]), real_ingredients).heated(); } else { - // If we have 3 or fewer ingredients, we can create it in the 3-slot thermal smelter - if (real_ingredients.length <= 3) { - event.recipes.thermal.smelter(ingotType.withCount(ingredients[0]), real_ingredients); - event.recipes.create.mixing(ingotType.withCount(ingredients[0]), real_ingredients).heated(); - } else { - // Materials with 4 or more require superheating, and can only be made in the mixer - event.recipes.create.mixing(ingotType.withCount(ingredients[0]), real_ingredients).superheated(); - } + // Materials with 4 or more require superheating, and can only be made in the mixer + event.recipes.create.mixing(ingotType.withCount(ingredients[0]), real_ingredients).superheated(); } } } @@ -285,7 +333,7 @@ ServerEvents.recipes(event => { // Vanilla tier: Ores need an ore hammer, and alloys can be crafted on the crafting table for (const tier of ['primitive', 'vanilla']) { for (const [metal, ingredients] of Object.entries(progression[tier])) { - let rawType = metalForm(metal, 'raw_materials', 'ore'); + let rawIngredients = rawForms(metal); let dustType = metalForm(metal, 'dusts', 'dust'); let ingotType = metalForm(metal, 'ingots', 'ingot'); let rawBlockType = metalForm(`raw_${metal}`, 'storage_blocks', 'block'); @@ -293,51 +341,32 @@ ServerEvents.recipes(event => { console.log(`Building vanilla processing for ${metal}...`); // Crush raw ore into dust with an ore hammer, in crafting table and in the deployer - if (rawType.id != 'minecraft:air') { - event.shapeless(dustType, [rawType, '#alltheores:ore_hammers']); + if (rawIngredients != null) { + event.shapeless(dustType, [rawIngredients, '#alltheores:ore_hammers']); event.shapeless(dustType.withCount(9), [rawBlockType, '#alltheores:ore_hammers']); - event.recipes.create.deploying([dustType], [rawType, '#alltheores:ore_hammers']).keepHeldItem(); + event.recipes.create.deploying([dustType], [rawIngredients, '#alltheores:ore_hammers']).keepHeldItem(); event.recipes.create.deploying([dustType.withCount(9)], [rawBlockType, '#alltheores:ore_hammers']).keepHeldItem(); } else { - console.warn(`No ${metal} ore hammer smashing available!`); + console.log(`No ${metal} ore hammer smashing available due to missing raw form!`); } - // TODO: alloy ingredients - for (const form of ['ingots', 'dusts']) { - let real_ingredients = []; - for (const ingredient of ingredients.slice(1)) { - let real_item = Item.of(ingredient); - if (real_item.id == 'minecraft:air') { - let parts = ingredient.split(' '); - if (parts.length == 1) { - real_item = metalForm(parts[0], form); - } else { - real_item = metalForm(parts[1], form).withCount(parts[0].split('x')[0]); - } - } - - if (real_item.id == 'minecraft:air') { - console.error(`Unknown or invalid ${metal} alloy ingredient: ${ingredient}`); - } else { - real_ingredients.push(real_item); - } - } + let real_ingredients = alloyIngredients(['ingots', 'dusts'], ingredients); - if (real_ingredients.length > 0 && ingotType.id != 'minecraft:air') { - event.shapeless(ingotType.withCount(ingredients[0]), real_ingredients); - } + if (real_ingredients.length > 0 && ingotType.id != 'minecraft:air') { + event.shapeless(ingotType.withCount(ingredients[0]), real_ingredients); } } } + // Andesite alloy is the progression item, as it unlocks most of the next tier of create - event.shapeless('create:andesite_alloy', [global.dustItem('tin'), '2x minecraft:andesite']); + //event.shapeless('create:andesite_alloy', [global.dustItem('tin'), '2x minecraft:andesite']); let xpNugget = Item.of('create:experience_nugget'); // Andesite age: Crushing wheels to crush, then the crushed ore is smelted normally. Alloys require the create mixer. Ore washing to double crushed ore is unlocked, but fans require invar instead of iron. Gears can be crafted on a crafting table for (const tier of ['primitive', 'vanilla', 'andesite']) { for (const [metal, ingredients] of Object.entries(progression[tier])) { - let rawType = metalForm(metal, 'raw_materials', 'ore'); + let rawIngredients = rawForms(metal); let crushedType = Item.of(`create:crushed_raw_${metal}`); let dustType = metalForm(metal, 'dusts', 'dust'); let ingotType = metalForm(metal, 'ingots', 'ingot'); @@ -347,11 +376,11 @@ ServerEvents.recipes(event => { console.log(`Building andesite processing for ${metal}...`); - if (rawType.id != 'minecraft:air') { + if (rawIngredients != null) { if (crushedType.id != 'minecraft:air') { - event.recipes.create.crushing([crushedType.withCount(2), xpNugget.withCount(2).withChance(0.75)], rawType); + event.recipes.create.crushing([crushedType.withCount(2), xpNugget.withCount(2).withChance(0.75)], rawIngredients); event.recipes.create.crushing([crushedType.withCount(18), xpNugget.withCount(18).withChance(0.75)], rawBlockType); - event.recipes.create.milling([crushedType.withCount(2)], rawType); + event.recipes.create.milling([crushedType.withCount(2)], rawIngredients); event.recipes.create.milling([crushedType.withCount(18)], rawBlockType); event.smelting(ingotType, crushedType); @@ -384,29 +413,10 @@ ServerEvents.recipes(event => { console.warn(`No ${metal} plates available!`); } - // TODO: alloy ingredients - for (const form of ['ingots', 'dusts']) { - let real_ingredients = []; - for (const ingredient of ingredients.slice(1)) { - let real_item = Item.of(ingredient); - if (real_item.id == 'minecraft:air') { - let parts = ingredient.split(' '); - if (parts.length == 1) { - real_item = metalForm(parts[0], form); - } else { - real_item = metalForm(parts[1], form).withCount(parts[0].split('x')[0]); - } - } - - if (real_item.id == 'minecraft:air') { - console.error(`Unknown or invalid ${metal} alloy ingredient: ${ingredient}`); - } - real_ingredients.push(real_item); - } + let real_ingredients = alloyIngredients(['ingots', 'dusts'], ingredients); - if (real_ingredients.length > 0) { - event.recipes.create.mixing(ingotType.withCount(ingredients[0]), real_ingredients).heated(); - } + if (real_ingredients.length > 0) { + event.recipes.create.mixing(ingotType.withCount(ingredients[0]), real_ingredients).heated(); } } } @@ -420,45 +430,24 @@ ServerEvents.recipes(event => { // Mechanical/grist age: Ores require diamond pick, crushed in the pulverizer, and crushed ore is smelted normally. Alloys require blending dusts in a heated mixer, then smelting the blend. 4x ore centrifuge is unlocked after creating a constantan gear on the crafting table. Other gears require the press. for (const tier of ['primitive', 'vanilla', 'andesite', 'mechanical']) { for (const [metal, ingredients] of Object.entries(progression[tier])) { - let rawType = metalForm(metal, 'raw_materials', 'ore'); let crushedType = Item.of(`create:crushed_raw_${metal}`); let dustType = metalForm(metal, 'dusts', 'dust'); let ingotType = metalForm(metal, 'ingots', 'ingot'); console.log(`Building mechanical processing for ${metal}...`); - if (rawType.id != 'minecraft:air') { - if (crushedType.id != 'minecraft:air') { - // Crushed ores are created in the industrial tier code, but mechanical tier and below are the only ones that don't need a centrifuge first - // This allows Nickel to be processed into a constantan gear, which unlocks the centrifuge - event.smelting(ingotType, [crushedType]); - } else { - console.error(`No ${metal} ore pulverizing available! Falling back to dust-based processing line`); - } + if (crushedType.id != 'minecraft:air') { + // Crushed ores are created in the industrial tier code, but mechanical tier and below are the only ones that don't need a centrifuge first + // This allows Nickel to be processed into a constantan gear, which unlocks the centrifuge + event.smelting(ingotType, [crushedType]); + } else { + console.error(`No ${metal} ore pulverizing available! Falling back to dust-based processing line`); } - for (const form of ['dusts']) { - let real_ingredients = []; - for (const ingredient of ingredients.slice(1)) { - let real_item = Item.of(ingredient); - if (real_item.id == 'minecraft:air') { - let parts = ingredient.split(' '); - if (parts.length == 1) { - real_item = metalForm(parts[0], form); - } else { - real_item = metalForm(parts[1], form).withCount(parts[0].split('x')[0]); - } - } + let real_ingredients = alloyIngredients(['dusts'], ingredients); - if (real_item.id == 'minecraft:air') { - console.error(`Unknown or invalid ${metal} alloy ingredient: ${ingredient}`); - } - real_ingredients.push(real_item); - } - - if (real_ingredients.length > 0) { - event.recipes.create.mixing(dustType.withCount(ingredients[0]), real_ingredients).heated(); - } + if (real_ingredients.length > 0) { + event.recipes.create.mixing(dustType.withCount(ingredients[0]), real_ingredients).heated(); } } } @@ -467,13 +456,13 @@ ServerEvents.recipes(event => { // Industrial age: Ores require centrifuging, alloys require basic grists, gears can only be made with a gear die for (const tier of ['primitive', 'vanilla', 'andesite', 'mechanical', 'industrial']) { for (const [metal, ingredients] of Object.entries(progression[tier])) { - let rawType = metalForm(metal, 'raw_materials', 'ore'); + let rawIngredients = rawForms(metal); let crushedType = Item.of(`create:crushed_raw_${metal}`); let dustType = metalForm(metal, 'dusts', 'dust'); let rawBlockType = metalForm(`raw_${metal}`, 'storage_blocks', 'block'); - if (rawType.id != 'minecraft:air') { + if (rawIngredients != null) { if (crushedType.id != 'minecraft:air') { - event.recipes.thermal.pulverizer([crushedType.withCount(4), crushedType.withChance(0.25), xpNugget.withCount(4).withChance(0.75)], rawType); + event.recipes.thermal.pulverizer([crushedType.withCount(4), crushedType.withChance(0.25), xpNugget.withCount(4).withChance(0.75)], rawIngredients); event.recipes.thermal.pulverizer([crushedType.withCount(4 * 9), crushedType.withChance(0.25), xpNugget.withCount(4 * 9).withChance(0.75)], rawBlockType); event.recipes.thermal.centrifuge([dustType.withCount(4), dustType.withChance(0.25)], crushedType); } else { @@ -482,263 +471,45 @@ ServerEvents.recipes(event => { } } } + + // Generate clay from centrifuing ash or gravel + event.recipes.thermal.centrifuge([ + Item.of('minecraft:clay_ball').withChance(1.05), + Item.of('minecraft:clay_ball').withChance(0.25)], + 'supplementaries:ash_brick' + ); + event.recipes.thermal.centrifuge([ + Item.of('minecraft:clay_ball').withChance(1.75), + Item.of('minecraft:clay_ball').withChance(0.85)], + 'minecraft:gravel' + ); + // Let quartz dust be created in the crafting table with a hammer + event.shapeless('thermal:quartz_dust', + ['minecraft:quartz', '#alltheores:ore_hammers'] + ).id('kubejs:quartz_dust_crushing'); + + // Fix up the diamond gear recipe, which somehow has two duplicates + event.remove({output: 'thermal:diamond_gear'}); + event.shaped('thermal:diamond_gear', [ + ' A ', + 'ABA', + ' A ' + ], { + 'A': 'minecraft:diamond', + 'B': '#kubejs:grist/build/basic' + }); + + //event.recipes.create.crushing(dustType, dustSource); + event.recipes.create.milling('create:powdered_obsidian', 'minecraft:obsidian'); }); -function foobar() { +function shpaes() { event.shapeless('thermal:quartz_dust', ['8x minecraft:granite', '#alltheores:ore_hammers']).id('kubejs:quartz_dust_from_granit_crushing_manual_only'); event.shapeless('thermal:quartz_dust', ['minecraft:quartz', '#alltheores:ore_hammers']).id('kubejs:quartz_dust_crushing_manual_only'); - - // All metals can be processed in the pulverizer/crusher, make plates in the press, and make gears with the die - { - let _ = ['copper', 'rose_gold', 'aluminum', 'constantan', 'iron', 'tin', 'nickel', 'gold', 'zinc', 'brass', 'invar', 'bronze', 'silver', 'platinum', 'lead', 'iridium', 'osmium', 'lumium', 'enderium', 'electrum', 'signalum', 'steel', 'uranium'].forEach(metal => { - console.log(`Setting up Tier 3 ${metal} processing...`); - - let gearType = metalForm(metal, 'gears', 'gear'); - let dustType = metalForm(metal, 'dusts', 'dust'); - let plateType = metalForm(metal, 'plates', 'plate'); - let ingotType = metalForm(metal, 'ingots', 'ingot'); - let rawType = metalForm(metal, 'raw_materials', 'ore'); - let blockType = metalForm(`raw_${metal}`, 'storage_blocks', 'block'); - let crushedType = Item.of(`create:crushed_raw_${metal}`); - - event.remove({output: gearType}); - event.remove({output: plateType}); - - event.remove({input: `#forge:ores/${metal}`}); - event.remove({input: `#forge:raw_materials/${metal}`}); - - // By default, you can't make any blends in the crafting table. - event.remove({output: dustType, type: 'minecraft:crafting'}); - event.remove({output: ingotType, input: 'minecraft:fire_charge'}); - - // Remove the default conversion of ingot to nuggets from create - event.remove({input: ingotType, type: 'create:crushing'}); - - // And completely eliminate the default refining line with create crushed ores - if (crushedType.id != 'minecraft:air') { - event.remove({input: crushedType}); - event.remove({output: crushedType}); - } else { - console.log(`metals: Missing create:crushed_raw_${metal}`); - } - - event.remove({id: `alltheores:${metal}_dust_from_alloy_blending`}); - - console.log(`crushing ${rawType.toJson()} ${dustType.toJson()}`); - if (rawType.id != "minecraft:air") { - event.custom({ - type: "thermal:pulverizer", - ingredients: [ - {tag: `forge:raw_materials/${metal}`} - ], - result: [ - {item: dustType.id, chance: 1.05}, - {item: dustType.id, chance: 0.25} - ], - experience: 0.5 - }); - - if (crushedType.id != 'minecraft:air') { - event.custom({ - type: "create:crushing", - ingredients: [ - {tag: `forge:raw_materials/${metal}`} - ], - results: [ - {item: crushedType.id, chance: 1}, - {item: crushedType.id, chance: 0.25}, - {item: dustType.id, chance: 0.05}, - {item: 'create:experience_nugget', count: 2, chance: 0.75} - ], - }); - } - } - - if (blockType.id != "minecraft:air") { - event.custom({ - type: "thermal:pulverizer", - ingredients: [ - {tag: `forge:storage_blocks/raw_${metal}`} - ], - result: [ - {item: dustType.id, count: 9, chance: 1}, - {item: dustType.id, count: 9, chance: 0.25} - ], - experience: 0.5 - }); - - if (crushedType.id != 'minecraft:air') { - event.custom({ - type: "create:crushing", - ingredients: [ - {tag: `forge:storage_blocks/raw_${metal}`} - ], - results: [ - {item: crushedType.id, count: 9, chance: 1}, - {item: crushedType.id, count: 9, chance: 0.25}, - {item: dustType.id, count: 9, chance: 0.05}, - {item: 'create:experience_nugget', count: 2 * 9, chance: 0.75} - ], - }); - } - } - - // Set up the parallel create-based ore washing line - if (crushedType.id != 'minecraft:air') { - event.custom({ - type: "create:splashing", - ingredients: [ - {item: crushedType.id } - ], - results: [ - {item: dustType.id, count: 2, chance: 1}, - {item: dustType.id, chance: 0.25}, - {item: dustType.id, chance: 0.05}, - ], - }); - - event.custom({ - type: "thermal:centrifuge", - ingredients: [ - {item: crushedType.id } - ], - result: [ - {item: dustType.id, count: 3, chance: 3.0}, - {item: dustType.id, chance: 0.75}, - {item: "twigs:pebble", chance: 0.05} - ], - }); - } - - // 1 dust = 1 ingot - event.custom({ - type: "thermal:pulverizer", - ingredients: [ - ingotType.toJson() - ], - result: [ - dustType.toJson() - ], - }); - - event.custom({ - type: "create:crushing", - ingredients: [ - ingotType.toJson() - ], - results: [ - dustType.toJson() - ], - }); - - // 4 ingots = 1 gear - event.custom({ - type: "thermal:press", - ingredients: [ - ingotType.withCount(4).toJson(), - { item: "thermal:press_gear_die" } - ], - result: [gearType.toJson()] - }); - - // 1 ingot = 1 plate - event.custom({ - type: "thermal:press", - ingredients: [ - ingotType.toJson(), - ], - result: [plateType.toJson()] - }); - event.custom({ - type: "create:pressing", - ingredients: [ - ingotType.toJson(), - ], - results: [plateType.toJson()] - }); - });} - - // But only these metals can be processed without a machine - {let _ = ['copper', 'iron', 'tin', 'nickel', 'zinc', 'brass', 'bronze', 'lead', 'aluminum'].forEach(metal => { - console.log(`Setting up ${metal} manual processing...`); - let gearID = metalForm(metal, 'gears', 'gear'); - let plateID = metalForm(metal, 'plates', 'plate'); - let dustID = metalForm(metal, 'dusts', 'dust'); - event.shaped(gearID, [ - ' A ', - 'ABA', - ' A ' - ], { - 'A': global.ingotItem(metal), - 'B': '#forge:gems' - }); - event.shapeless(plateID, [global.ingotItem(metal, 2), '#alltheores:ore_hammers']).id(`kubejs:plate_crushing_${metal}_manual_only`); - event.shapeless(dustID, [global.ingotItem(metal), '#alltheores:ore_hammers']).id(`kubejs:ore_crushing_${metal}_manual_only`); - });} - - // And only these ores can be hammered or crushed - {let _ = ['copper', 'iron', 'tin', 'nickel', 'zinc', 'lead', 'aluminum', 'gold'].forEach(ore => { - console.log(`Setting up ${ore} hammering...`); - let dustType = metalForm(ore, 'dusts', 'dust'); - event.shapeless(dustType.withCount(2), [`#forge:raw_materials/${ore}`, '#alltheores:ore_hammers']).id(`kubejs:ore_crushing_2_${ore}_manual_only`); - event.shapeless(dustType.withCount(2 * 9), [`#forge:storage_blocks/raw_${ore}`, '#alltheores:ore_hammers']).id(`kubejs:ore_block_crushing_${ore}_manual_only`); - });} - + // And only copper can be smelted without pulverizing event.smelting(global.ingotItem('copper'), metalForm('copper', 'raw_materials', 'ore')); - console.log(`Setting up blends...`); - // These are the only blends you can make by hand, aka pre-smelter alloys - // FIXME: Remove the hammer from the create mixer - event.shapeless(Item.of(metalForm('bronze', 'dusts', 'dust').withCount(4)), [ - global.dustItem('tin', 2), - global.dustItem('copper', 2), - '#alltheores:ore_hammers' - ]).id('kubejs:bronze_mixing_manual_only'); - event.custom({ - type: "create:mixing", - ingredients: [ - global.dustItem('tin', 2), - global.dustItem('copper', 2), - ], - results: [global.dustItem('tin', 4)] - }); - - event.shapeless(Item.of(metalForm('brass', 'dusts', 'dust').withCount(4)), [ - global.dustItem('copper', 3), - global.dustItem('zinc', 1), - '#alltheores:ore_hammers' - ]).id(`kubejs:brass_mixing_manual_only`); - event.custom({ - type: "create:mixing", - ingredients: [ - global.dustItem('copper', 3), - global.dustItem('zinc', 1), - ], - results: [global.dustItem('brass', 4)] - }); - - event.shapeless(Item.of(metalForm('invar', 'dusts', 'dust').withCount(4)), [ - global.dustItem('iron', 2), - global.dustItem('nickel', 2), - '#alltheores:ore_hammers' - ]).id('kubejs:invar_mixing_manual_only'); - event.custom({ - type: "create:mixing", - ingredients: [ - global.dustItem('iron', 2), - global.dustItem('nickel', 2), - ], - results: [global.dustItem('invar', 4)] - }); - - // Constantan dust consumes your first build grist, and it unlocks the basic grist production line - event.shapeless(Item.of(metalForm('constantan', 'dusts', 'dust').withCount(4)),[ - global.ingotItem('nickel', 2), - global.ingotItem('copper', 2), - '#kubejs:grist/build/basic', - '#alltheores:ore_hammers' - ]).id('kubejs:constantan_dust_mixing_manual_only'); // Constantan is the only metal you can't work on the bench except for gears event.shaped('thermal:constantan_gear', [ ' A ', @@ -757,7 +528,7 @@ function foobar() { 'A': 'minecraft:diamond', 'B': 'minecraft:crying_obsidian' }); - + // Lapis can be pulverized and hammered. event.remove({output: 'thermal:lapis_dust', type: 'thermal:pulverizer'}); event.custom({ diff --git a/kubejs/startup_scripts/rarities.js b/kubejs/startup_scripts/rarities.js index 62f483d..2313d98 100644 --- a/kubejs/startup_scripts/rarities.js +++ b/kubejs/startup_scripts/rarities.js @@ -67,6 +67,7 @@ RarityJSEvents.register(event => { event.setRarity('create:windmill_bearing', 'kubejs:energetic_grist'); event.setRarity('immersive_aircraft:boiler', 'kubejs:energetic_grist'); event.setRarity('iron_furnaces:augment_factory', 'kubejs:energetic_grist'); + // "$INST_JAVA" -jar packwiz-installer-bootstrap.jar https://gitea.malloc.hackerbots.net/tdfischer/malloc-s4/raw/branch/main/pack.toml event.setRarityByMod('thermal', 'kubejs:build_grist'); event.setRarityByMod('ironfurnaces', 'kubejs:build_grist'); diff --git a/pack.toml b/pack.toml index 8670c39..db7c2b3 100644 --- a/pack.toml +++ b/pack.toml @@ -6,7 +6,7 @@ pack-format = "packwiz:1.1.0" [index] file = "index.toml" hash-format = "sha256" -hash = "418a99b12d8d5d98b7a47ac72586c2833cf08315486e9ba0575a24cf0c5c1467" +hash = "ff8003c9cacc6a7708f6ae87c1e8387a7673749b5608bc95198bf51426d8bf25" [versions] forge = "47.4.0"