From c27e40b494f9465aa5caea75a394cb880333582c Mon Sep 17 00:00:00 2001 From: copygirl Date: Tue, 19 Jul 2022 00:09:14 +0200 Subject: [PATCH] Remove Corail Woodcutter, use stonecutter --- docs/MODS.md | 2 - kubejs/server_scripts/_global.js | 10 - .../fixes/sawmill_jungle_post.js | 17 -- kubejs/server_scripts/recipes/sawmill.js | 56 ----- .../recipes/stonecutter_cuts_wood.js | 204 ++++++++++++++++++ .../server_scripts/recipes/storage_drawers.js | 16 +- mods/corail-woodcutter.pw.toml | 13 -- 7 files changed, 212 insertions(+), 106 deletions(-) delete mode 100644 kubejs/server_scripts/fixes/sawmill_jungle_post.js delete mode 100644 kubejs/server_scripts/recipes/sawmill.js create mode 100644 kubejs/server_scripts/recipes/stonecutter_cuts_wood.js delete mode 100644 mods/corail-woodcutter.pw.toml diff --git a/docs/MODS.md b/docs/MODS.md index 2474c0b..3dd3936 100644 --- a/docs/MODS.md +++ b/docs/MODS.md @@ -52,8 +52,6 @@ Apply banners to beds - ![](icon/cf.png) [Comforts](https://www.curseforge.com/minecraft/mc-mods/comforts) - Sleeping bags that don't set your spawn and hammocks that skip day -- ![](icon/cf.png) [Corail Woodcutter](https://www.curseforge.com/minecraft/mc-mods/corail-woodcutter) - - Sawmill, a stonecutter equivalent, but for wood - ![](icon/mr.png) [Eccentric Tome](https://modrinth.com/mod/eccentric-tome) - Book for storing other guide books - ![](icon/cf.png) [Farmer's Delight](https://www.curseforge.com/minecraft/mc-mods/farmers-delight) - diff --git a/kubejs/server_scripts/_global.js b/kubejs/server_scripts/_global.js index ae4f7cb..a378379 100644 --- a/kubejs/server_scripts/_global.js +++ b/kubejs/server_scripts/_global.js @@ -1,15 +1,5 @@ // priority: 100 -// Add sawmill recipe (from Corail Woodcutter) -function sawmill(event, output, input) { - let i = Ingredient.of(input); - let o = Item.of(output); - event.custom({ - type: "corail_woodcutter:woodcutting", - ingredient: i.toJson(), result: o.getId(), count: o.getCount() - }); -} - // Add brewing recipe (from Farmer's Respite) // "brewingtime" tends to be 100 for simple recipes, 2400 for things that need to be brewed // "needwater" can be set to false if liquid is already supplied diff --git a/kubejs/server_scripts/fixes/sawmill_jungle_post.js b/kubejs/server_scripts/fixes/sawmill_jungle_post.js deleted file mode 100644 index 5cf9846..0000000 --- a/kubejs/server_scripts/fixes/sawmill_jungle_post.js +++ /dev/null @@ -1,17 +0,0 @@ -// priority: 0 - -onEvent("recipes", event => { - event.remove({ id: "corail_woodcutter:woodcutting/quark/jungle_post_from_jungle_logs" }); - event.remove({ id: "corail_woodcutter:woodcutting/quark/jungle_post_from_jungle_planks" }); - - event.custom({ - type: "corail_woodcutter:woodcutting", - ingredient: { tag: "minecraft:jungle_logs" }, - result: "quark:jungle_post", count: 4 - }); - event.custom({ - type: "corail_woodcutter:woodcutting", - ingredient: { tag: "forge:planks/jungle" }, - result: "quark:jungle_post", count: 1 - }); -}); diff --git a/kubejs/server_scripts/recipes/sawmill.js b/kubejs/server_scripts/recipes/sawmill.js deleted file mode 100644 index 320c32e..0000000 --- a/kubejs/server_scripts/recipes/sawmill.js +++ /dev/null @@ -1,56 +0,0 @@ -// priority: 0 - -onEvent("recipes", event => { - let minecraft_wood_types = [ - "oak", "spruce", "birch", "jungle", - "acacia", "dark_oak", "crimson", "warped" - ]; - let bop_wood_types = [ - "cherry", "dead", "fir", "jacaranda", "magic", - "mahogany", "palm", "redwood", "umbran", "willow" - ]; - - // Posts, platforms and steps (Adorn) - event.remove({ mod: "adorn", type: "minecraft:stonecutting", output: "#adorn:wooden_posts" }); - event.remove({ mod: "adorn", type: "minecraft:stonecutting", output: "#adorn:wooden_platforms" }); - event.remove({ mod: "adorn", type: "minecraft:stonecutting", output: "#adorn:wooden_steps" }); - for (let wood_type of minecraft_wood_types) { - sawmill(event, `2x adorn:${wood_type}_post` , `minecraft:${wood_type}_planks`); - sawmill(event, `1x adorn:${wood_type}_platform`, `minecraft:${wood_type}_planks`); - sawmill(event, `2x adorn:${wood_type}_step` , `minecraft:${wood_type}_planks`); - } - for (let wood_type of bop_wood_types) { - sawmill(event, `2x adorn:biomesoplenty/${wood_type}_post` , `biomesoplenty:${wood_type}_planks`); - sawmill(event, `1x adorn:biomesoplenty/${wood_type}_platform`, `biomesoplenty:${wood_type}_planks`); - sawmill(event, `2x adorn:biomesoplenty/${wood_type}_step` , `biomesoplenty:${wood_type}_planks`); - } - - // Posts (Quark) - for (let wood_type of bop_wood_types) { - sawmill(event, `1x compatoplenty:stripped_${wood_type}_post`, `biomesoplenty:${wood_type}_planks`); - sawmill(event, `4x compatoplenty:stripped_${wood_type}_post`, `#biomesoplenty:${wood_type}_logs` ); - sawmill(event, `1x compatoplenty:${wood_type}_post`, `biomesoplenty:${wood_type}_planks`); - sawmill(event, `4x compatoplenty:${wood_type}_post`, `#biomesoplenty:${wood_type}_logs` ); - } - - // Vertical planks - for (let wood_type of bop_wood_types) { - sawmill(event, `1x compatoplenty:vertical_${wood_type}_planks`, `biomesoplenty:${wood_type}_planks`); - sawmill(event, `4x compatoplenty:vertical_${wood_type}_planks`, `#biomesoplenty:${wood_type}_logs` ); - } - - // Vertical slabs - for (let wood_type of bop_wood_types) { - sawmill(event, `2x compatoplenty:${wood_type}_vertical_slab`, `biomesoplenty:${wood_type}_planks`); - sawmill(event, `8x compatoplenty:${wood_type}_vertical_slab`, `#biomesoplenty:${wood_type}_logs` ); - } - - // Ladders - event.remove({type: "corail_woodcutter:woodcutting", output: "minecraft:ladder" }); - sawmill(event, `1x minecraft:ladder`, `minecraft:oak_planks`); - sawmill(event, `4x minecraft:ladder`, `#minecraft:oak_logs` ); - for (let wood_type of bop_wood_types) { - sawmill(event, `1x compatoplenty:${wood_type}_ladder`, `biomesoplenty:${wood_type}_planks`); - sawmill(event, `4x compatoplenty:${wood_type}_ladder`, `#biomesoplenty:${wood_type}_logs` ); - } -}); diff --git a/kubejs/server_scripts/recipes/stonecutter_cuts_wood.js b/kubejs/server_scripts/recipes/stonecutter_cuts_wood.js new file mode 100644 index 0000000..7a396ee --- /dev/null +++ b/kubejs/server_scripts/recipes/stonecutter_cuts_wood.js @@ -0,0 +1,204 @@ +// priority: 0 + +onEvent("recipes", event => { + event.stonecutting("2x minecraft:stick", "#minecraft:planks"); + event.stonecutting("2x minecraft:bowl" , "#minecraft:planks"); + event.stonecutting("tconstruct:pattern", "#minecraft:planks"); + + let COSTS = { + // Logs + wood: { log: 1 }, + stripped_log: { log: 1 }, + stripped_wood: { log: 1, wood: 1, stripped_log: 1, }, + // Items from Logs + planks: { any_log: 4 }, + boat: { any_log: 1 }, + beam: { any_log: 1 }, + palisade: { any_log: 4 }, + post: { log: 4, wood: 4 }, + stripped_post: { any_log: 4 }, + // Items from Planks + stairs: { planks: 1 }, + slab: { planks: 2 }, + ladder: { planks: 2 }, + door: { planks: 1 }, + trapdoor: { planks: 1 }, + fence: { planks: 1 }, + fence_gate: { planks: 1 }, + button: { planks: 4 }, + pressure_plate: { planks: 2 }, + sign: { planks: 1 }, + support: { planks: 1 }, + seat: { planks: 1 }, + vertical_planks: { planks: 1, any_log: 4 }, + vertical_slab: { planks: 2 }, + chair: { planks: 1 }, + table: { planks: 1 }, + shelf: { planks: 1 }, + bench: { planks: 2 }, + backpack_shelf: { planks: 2 }, + banister: { planks: 2 }, + }; + + let WOOD_TYPES = { + minecraft: [ "oak", "spruce", "birch", "jungle", "acacia", "dark_oak", "crimson", "warped" ], + biomesoplenty: [ "cherry", "dead", "fir", "hellbark", "jacaranda", "magic", "mahogany", "palm", "redwood", "umbran", "willow" ], + twilightforest: [ "twilight_oak", "canopy", "mangrove", "dark", "time", "transformation", "mining", "sorting" ], + quark: [ "azalea", "blossom" ], + }; + + let DEFAULT_FORMAT = { + DEFAULT: "{MOD}:{WOOD}_{TYPE}", + any_log: "#{MOD}:{WOOD}_logs", + stripped_log: "{MOD}:stripped_{WOOD}_log", + stripped_wood: "{MOD}:stripped_{WOOD}_wood", + stripped_post: "{MOD}:stripped_{WOOD}_post", + vertical_planks: "{MOD}:vertical_{WOOD}_planks", + }; + + let DEFINITIONS = { + minecraft: [ + { + woods: WOOD_TYPES.minecraft, + types: [ "planks", "stairs", "slab", "door", "trapdoor", "fence", "fence_gate", "sign", "button", "pressure_plate" ], + }, + { + woods: [ "oak", "spruce", "birch", "jungle", "acacia", "dark_oak" ], + types: [ "any_log", "log", "wood", "stripped_log", "stripped_wood", "boat" ], + }, + { + woods: [ "crimson", "warped" ], + types: [ "any_log", "log", "wood", "stripped_log", "stripped_wood" ], + format: { + any_log: "#{MOD}:{WOOD}_stems", + log: "{MOD}:{WOOD}_stem", + wood: "{MOD}:{WOOD}_hyphae", + stripped_log: "{MOD}:stripped_{WOOD}_stem", + stripped_wood: "{MOD}:stripped_{WOOD}_hyphae", + }, + }, + { + woods: [ "oak" ], + types: [ "ladder" ], + format: { ladder: "{MOD}:{TYPE}" }, + }, + ], + decorative_blocks: [ + { + woods: WOOD_TYPES.minecraft, + types: [ "beam", "palisade", "support", "seat" ], + }, + ], + quark: [ + { + woods: WOOD_TYPES.quark, + types: [ + "any_log", "log", "wood", "stripped_log", "stripped_wood", + "planks", "stairs", "slab", "door", "trapdoor", "fence", "fence_gate", + "sign", "button", "pressure_plate", "boat", + "vertical_planks", "vertical_slab", "post", "stripped_post", + ], + format: { + stairs: "{MOD}:{WOOD}_planks_{TYPE}", + slab: "{MOD}:{WOOD}_planks_{TYPE}", + vertical_slab: "{MOD}:{WOOD}_planks_{TYPE}", + }, + }, + { + woods: WOOD_TYPES.minecraft, + types: [ "vertical_planks", "post", "stripped_post" ], + }, + { + woods: WOOD_TYPES.minecraft.concat(WOOD_TYPES.quark).filter(wood => wood != "oak"), + types: [ "ladder" ], + }, + ], + adorn: [ + { + woods: WOOD_TYPES.minecraft, + types: [ "chair", "table", "shelf", "bench" ], + }, + { + woods: WOOD_TYPES.biomesoplenty, + types: [ "chair", "table", "shelf", "bench" ], + format: { DEFAULT: "{MOD}:biomesoplenty/{WOOD}_{TYPE}" }, + }, + ], + backpacked: [ + { + woods: WOOD_TYPES.minecraft, + types: [ "backpack_shelf" ], + }, + ], + biomesoplenty: [ + { + woods: WOOD_TYPES.biomesoplenty, + types: [ + "any_log", "log", "wood", "stripped_log", "stripped_wood", + "planks", "stairs", "slab", "door", "trapdoor", "fence", "fence_gate", + "sign", "button", "pressure_plate", "boat", + ], + } + ], + twilightforest: [ + { + woods: WOOD_TYPES.twilightforest, + types: [ + "any_log", "log", "wood", "stripped_log", "stripped_wood", + "planks", "stairs", "slab", "door", "trapdoor", "fence", "fence_gate", + "button", "pressure_plate", + ], + }, + { + woods: WOOD_TYPES.twilightforest.filter(wood => wood != "dark"), + types: [ "sign" ], + }, + { + woods: WOOD_TYPES.minecraft.concat(WOOD_TYPES.twilightforest).filter(wood => wood != "dark"), + types: [ "banister" ], + }, + { + woods: [ "dark" ], + types: [ "sign", "banister" ], + format: { DEFAULT: "{MOD}:darkwood_{TYPE}" }, + }, + ], + compatoplenty: [ + { + woods: WOOD_TYPES.biomesoplenty, + types: [ "vertical_planks", "vertical_slab", "post", "stripped_post", "ladder" ], + }, + ], + }; + + let items = { }; + // Collect all definitions into "items". + // { oak: { planks: "minecraft:oak_planks", ... }, ... } + for (let mod in DEFINITIONS) { + for (let { woods, types, format } of DEFINITIONS[mod]) { + format = Object.assign({ }, DEFAULT_FORMAT, format); + for (let wood of woods) { + let items_by_wood = items[wood] = items[wood] || { }; + for (let type of types) { + let item = (format[type] || format.DEFAULT) + .replace("{MOD}", mod) + .replace("{WOOD}", wood) + .replace("{TYPE}", type); + items_by_wood[type] = item; + } + } + } + } + // Register stonecutting recipes based on "COSTS". + for (let wood in items) { + for (let [type, item] of Object.entries(items[wood])) { + for (let [input, result_count] of Object.entries(COSTS[type] || { })) { + let o = `${result_count}x ${item}`; + let i = items[wood] && items[wood][input]; + // console.log(`${wood} ${type} :: ${i} => ${o}`); + if (i != null) event.stonecutting(o, i); + else console.error(`Can't create ${wood} ${type} recipe for ${item} since input wasn't found`); + } + } + } +}); diff --git a/kubejs/server_scripts/recipes/storage_drawers.js b/kubejs/server_scripts/recipes/storage_drawers.js index d47782d..20a6f01 100644 --- a/kubejs/server_scripts/recipes/storage_drawers.js +++ b/kubejs/server_scripts/recipes/storage_drawers.js @@ -34,19 +34,19 @@ onEvent("recipes", event => { event.remove({ output: "#storagedrawers:drawers" }); for (let material of materials) { - sawmill(event, `1x storagedrawers:${material}_full_drawers_1`, `storagedrawers:${material}_trim`); - sawmill(event, `1x storagedrawers:${material}_full_drawers_2`, `storagedrawers:${material}_trim`); - sawmill(event, `1x storagedrawers:${material}_full_drawers_4`, `storagedrawers:${material}_trim`); - sawmill(event, `2x storagedrawers:${material}_half_drawers_1`, `storagedrawers:${material}_trim`); - sawmill(event, `2x storagedrawers:${material}_half_drawers_2`, `storagedrawers:${material}_trim`); - sawmill(event, `2x storagedrawers:${material}_half_drawers_4`, `storagedrawers:${material}_trim`); + event.stonecutting(`1x storagedrawers:${material}_full_drawers_1`, `storagedrawers:${material}_trim`); + event.stonecutting(`1x storagedrawers:${material}_full_drawers_2`, `storagedrawers:${material}_trim`); + event.stonecutting(`1x storagedrawers:${material}_full_drawers_4`, `storagedrawers:${material}_trim`); + event.stonecutting(`2x storagedrawers:${material}_half_drawers_1`, `storagedrawers:${material}_trim`); + event.stonecutting(`2x storagedrawers:${material}_half_drawers_2`, `storagedrawers:${material}_trim`); + event.stonecutting(`2x storagedrawers:${material}_half_drawers_4`, `storagedrawers:${material}_trim`); } // Upgrades event.remove({ id: /storagedrawers:.*upgrade.*/ }); - sawmill(event, "4x storagedrawers:upgrade_template", "#heck:trim"); + event.stonecutting("4x storagedrawers:upgrade_template", "#heck:trim"); event.smithing("storagedrawers:obsidian_storage_upgrade", "storagedrawers:upgrade_template" , "#forge:gears/copper" ); event.smithing("storagedrawers:obsidian_storage_upgrade", "storagedrawers:upgrade_template" , "#forge:gears/tin" ); event.smithing("storagedrawers:iron_storage_upgrade" , "storagedrawers:obsidian_storage_upgrade", "#forge:gears/iron" ); @@ -66,7 +66,7 @@ onEvent("recipes", event => { for (let from of redstone_upgrades) for (let to of redstone_upgrades) if (from != to) - sawmill(event, `storagedrawers:${to}_upgrade`, `storagedrawers:${from}_upgrade`); + event.stonecutting(`storagedrawers:${to}_upgrade`, `storagedrawers:${from}_upgrade`); // Slave, Controller, Compacting Drawer diff --git a/mods/corail-woodcutter.pw.toml b/mods/corail-woodcutter.pw.toml deleted file mode 100644 index 8b825d5..0000000 --- a/mods/corail-woodcutter.pw.toml +++ /dev/null @@ -1,13 +0,0 @@ -name = "Corail Woodcutter" -filename = "corail_woodcutter-1.18.2-2.3.4.jar" -side = "both" - -[download] -hash-format = "sha1" -hash = "303ab36eace656cc39312a316e4175036dc5bd7b" -mode = "metadata:curseforge" - -[update] -[update.curseforge] -file-id = 3818180 -project-id = 331983