From 0d86b34c63e0f500b265245f6346e62c643bcf5a Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 29 May 2022 18:21:28 -0700 Subject: [PATCH 1/2] Implement ATM Armor Salvage Recipes --- .../mod_specific/silentsgear/silentsgear.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 kubejs/server_scripts/mod_specific/silentsgear/silentsgear.js diff --git a/kubejs/server_scripts/mod_specific/silentsgear/silentsgear.js b/kubejs/server_scripts/mod_specific/silentsgear/silentsgear.js new file mode 100644 index 00000000..29bcd40c --- /dev/null +++ b/kubejs/server_scripts/mod_specific/silentsgear/silentsgear.js @@ -0,0 +1,23 @@ +onEvent('recipes', e => { + // Output is an array of result objects. + // example: [{item: "minecraft:leather", count: 8}] + let salvage = (e, input, output) => { + e.custom({ + type: "silentgear:salvaging", + ingredient: { + item: input + }, + results: output + }) + } + + const nuggetRatio = {"helmet": 2, "chestplate": 4, "leggings": 3, "boots": 2} + + utils.listOf(['allthemodium', 'vibranium', 'unobtanium']) + .forEach(type => { + utils.listOf(['helmet', 'chestplate', 'leggings', 'boots']) + .forEach(armor => { + salvage(e, `allthemodium:${type}_${armor}`, [{item: `allthemodium:${type}_nugget`, count: nuggetRatio[armor]}]) + }) + }) +}) \ No newline at end of file From 757ac6890658ed31e586e8196ab528b40b8e834b Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 29 May 2022 19:10:37 -0700 Subject: [PATCH 2/2] Implement ATM Tool Salvage Recipes --- .../mod_specific/silentsgear/silentsgear.js | 45 +++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/kubejs/server_scripts/mod_specific/silentsgear/silentsgear.js b/kubejs/server_scripts/mod_specific/silentsgear/silentsgear.js index 29bcd40c..fb8d7152 100644 --- a/kubejs/server_scripts/mod_specific/silentsgear/silentsgear.js +++ b/kubejs/server_scripts/mod_specific/silentsgear/silentsgear.js @@ -11,13 +11,52 @@ onEvent('recipes', e => { }) } - const nuggetRatio = {"helmet": 2, "chestplate": 4, "leggings": 3, "boots": 2} + const armorNuggetRatio = {"helmet": 2, "chestplate": 4, "leggings": 3, "boots": 2} + const toolNuggetRatio = { + "pick": { + "allthemodium": 2, + "vibranium": 3, + "unobtainium": 3, + }, + "axe": { + "allthemodium": 2, + "vibranium": 3, + "unobtainium": 3, + }, + "sword": { + "allthemodium": 1, + "vibranium": 2, + "unobtainium": 2, + }, + "shovel": { + "allthemodium": 2, + "vibranium": 1, + "unobtainium": 1, + }, + "paxel": { + "allthemodium": 9, + "vibranium": 10, + "unobtainium": 10, + } + } - utils.listOf(['allthemodium', 'vibranium', 'unobtanium']) + utils.listOf(['allthemodium', 'vibranium', 'unobtainium']) .forEach(type => { utils.listOf(['helmet', 'chestplate', 'leggings', 'boots']) .forEach(armor => { - salvage(e, `allthemodium:${type}_${armor}`, [{item: `allthemodium:${type}_nugget`, count: nuggetRatio[armor]}]) + salvage(e, `allthemodium:${type}_${armor}`, [{item: `allthemodium:${type}_nugget`, count: armorNuggetRatio[armor]}]) }) }) + + utils.listOf(['pick', 'axe', 'sword', 'shovel', 'paxel']) + .forEach(tool => { + const result = []; + + utils.listOf(['allthemodium', 'vibranium', 'unobtainium']) + .forEach(nugget => { + result.push({"item": `allthemodium:${nugget}_nugget`, "count": toolNuggetRatio[tool][nugget]}) + }) + + salvage(e, `allthemodium:alloy_${tool}`, result) + }) }) \ No newline at end of file