From 9fa51dc6b9593a7723fde51ef23557b2a0b45137 Mon Sep 17 00:00:00 2001 From: NO11 Date: Mon, 10 May 2021 10:06:34 +0000 Subject: [PATCH] Simplify wooden planks crafting --- mods/ITEMS/mcl_core/crafting.lua | 95 ++++++++++---------------------- 1 file changed, 28 insertions(+), 67 deletions(-) diff --git a/mods/ITEMS/mcl_core/crafting.lua b/mods/ITEMS/mcl_core/crafting.lua index ded4364c3a..44f49a4d4d 100644 --- a/mods/ITEMS/mcl_core/crafting.lua +++ b/mods/ITEMS/mcl_core/crafting.lua @@ -4,84 +4,45 @@ -- Crafting definition -- -local craft_oak_planks = function(subname) +local craft_planks = function(output, input) minetest.register_craft({ - output = "mcl_core:wood 4", + output = "mcl_core:"..output.."wood 4", recipe = { - {"mcl_core:"..subname}, - } - }) -end -local craft_dark_oak_planks = function(subname) - minetest.register_craft({ - output = "mcl_core:darkwood 4", - recipe = { - {"mcl_core:"..subname}, - } - }) -end -local craft_jungle_planks = function(subname) - minetest.register_craft({ - output = "mcl_core:junglewood 4", - recipe = { - {"mcl_core:"..subname}, - } - }) -end -local craft_acacia_planks = function(subname) - minetest.register_craft({ - output = "mcl_core:acaciawood 4", - recipe = { - {"mcl_core:"..subname}, - } - }) -end -local craft_spruce_planks = function(subname) - minetest.register_craft({ - output = "mcl_core:sprucewood 4", - recipe = { - {"mcl_core:"..subname}, - } - }) -end -local craft_birch_planks = function(subname) - minetest.register_craft({ - output = "mcl_core:birchwood 4", - recipe = { - {"mcl_core:"..subname}, + {"mcl_core:"..input}, } }) end -craft_oak_planks("tree") -craft_oak_planks("tree_bark") -craft_oak_planks("stripped_oak") -craft_oak_planks("stripped_oak_bark") +craft_planks("", "tree") +craft_planks("", "tree_bark") +craft_planks("", "stripped_oak") +craft_planks("", "stripped_oak_bark") -craft_dark_oak_planks("darktree") -craft_dark_oak_planks("darktree_bark") -craft_dark_oak_planks("stripped_dark_oak") -craft_dark_oak_planks("stripped_dark_oak_bark") +craft_planks("dark", "darktree") +craft_planks("dark", "darktree_bark") +craft_planks("dark", "stripped_dark_oak") +craft_planks("dark", "stripped_dark_oak_bark") -craft_jungle_planks("jungletree") -craft_jungle_planks("jungletree_bark") -craft_jungle_planks("stripped_jungle") -craft_jungle_planks("stripped_jungle_bark") +craft_planks("jungle", "jungletree") +craft_planks("jungle", "jungletree_bark") +craft_planks("jungle", "stripped_jungle") +craft_planks("jungle", "stripped_jungle_bark") -craft_acacia_planks("acaciatree") -craft_acacia_planks("acaciatree_bark") -craft_acacia_planks("stripped_acacia") -craft_acacia_planks("stripped_acacia_bark") +craft_planks("acacia", "acaciatree") +craft_planks("acacia", "acaciatree_bark") +craft_planks("acacia", "stripped_acacia") +craft_planks("acacia", "stripped_acacia_bark") -craft_spruce_planks("sprucetree") -craft_spruce_planks("sprucetree_bark") -craft_spruce_planks("stripped_spruce") -craft_spruce_planks("stripped_spruce_bark") +craft_planks("spruce", "sprucetree") +craft_planks("spruce", "sprucetree_bark") +craft_planks("spruce", "stripped_spruce") +craft_planks("spruce", "stripped_spruce_bark") + +craft_planks("birch", "birchtree") +craft_planks("birch", "birchtree_bark") +craft_planks("birch", "stripped_birch") +craft_planks("birch", "stripped_birch_bark") -craft_birch_planks("birchtree") -craft_birch_planks("birchtree_bark") -craft_birch_planks("stripped_birch") -craft_birch_planks("stripped_birch_bark") minetest.register_craft({ type = 'shapeless',