From 9d0b609c6be5a6214e389327790be3eb03377b69 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Wed, 20 Dec 2023 11:24:29 +0000 Subject: [PATCH] Added Machine Recipes --- technic/init.lua | 127 ++++++++++++++++++ technic/machines/HV/quarry.lua | 2 +- technic/machines/LV/electric_furnace.lua | 6 +- technic/machines/register/alloy_recipes.lua | 8 +- .../machines/register/centrifuge_recipes.lua | 4 +- .../machines/register/extractor_recipes.lua | 31 +++-- technic/machines/register/freezer_recipes.lua | 8 +- technic/machines/register/grinder_recipes.lua | 59 ++++---- 8 files changed, 190 insertions(+), 55 deletions(-) diff --git a/technic/init.lua b/technic/init.lua index 11ddab8..4177c90 100644 --- a/technic/init.lua +++ b/technic/init.lua @@ -30,6 +30,27 @@ else iron_ingrediant = 'default:steel_ingot' end +iron_lump_ingrediant = nil +if minetest.get_modpath("mcl_core") then + iron_lump_ingrediant = "mcl_raw_ores:raw_iron" +else + iron_lump_ingrediant = 'default:iron_lump' +end + +gold_lump_ingrediant = nil +if minetest.get_modpath("mcl_core") then + gold_lump_ingrediant = "mcl_raw_ores:raw_gold" +else + gold_lump_ingrediant = 'default:gold_lump' +end + +copper_lump_ingrediant = nil +if minetest.get_modpath("mcl_core") then + copper_lump_ingrediant = "mcl_raw_ores:raw_copper" +else + copper_lump_ingrediant = 'default:copper_lump' +end + mese_crystal_ingrediant = nil if minetest.get_modpath("mcl_core") then mese_crystal_ingrediant = "mesecons:wire_00000000_off" @@ -180,6 +201,13 @@ else sand_ingrediant = 'default:sand' end +gravel_ingrediant = nil +if minetest.get_modpath("mcl_core") then + gravel_ingrediant = "mcl_core:gravel" +else + gravel_ingrediant = 'default:gravel' +end + desert_stone_ingrediant = nil if minetest.get_modpath("mcl_core") then desert_stone_ingrediant = "mcl_core:redsandstone" @@ -210,6 +238,13 @@ else mossy_cobble_ingrediant = 'default:mossycobble' end +cobble_ingrediant = nil +if minetest.get_modpath("mcl_core") then + cobble_ingrediant = "mcl_core:cobble" +else + cobble_ingrediant = 'default:cobble' +end + snow_block_ingrediant = nil if minetest.get_modpath("mcl_core") then snow_block_ingrediant = "mcl_core:snowblock" @@ -268,6 +303,98 @@ else stick_ingrediant = "default:stick" end +emtpy_bucket_ingrediant = nil +if minetest.get_modpath("mcl_core") then + emtpy_bucket_ingrediant = "mcl_buckets:bucket_empty" +else + emtpy_bucket_ingrediant = "bucket:bucket_empty" +end + +water_bucket_ingrediant = nil +if minetest.get_modpath("mcl_core") then + water_bucket_ingrediant = "mcl_buckets:bucket_water" +else + water_bucket_ingrediant = "bucket:bucket_water" +end + +-- Ingredient Variables + +if minetest.get_modpath("mcl_core") then + blueberries_ingredient = "mcl_farming:blueberries" -- If available in MineClone2 + grass_ingredient = "mcl_core:grass" + dry_shrub_ingredient = "mcl_core:deadbush" + junglegrass_ingredient = "mcl_core:tallgrass" -- Adjust as needed + cactus_ingredient = "mcl_core:cactus" + geranium_ingredient = "mcl_flowers:blue_orchid" + dandelion_white_ingredient = "mcl_flowers:oxeye_daisy" + dandelion_yellow_ingredient = "mcl_flowers:dandelion" + tulip_ingredient = "mcl_flowers:orange_tulip" -- Adjust for the tulip color + rose_ingredient = "mcl_flowers:poppy" + viola_ingredient = "mcl_flowers:allium" +else + -- Default Minetest Game ingredients + blueberries_ingredient = "default:blueberries" + grass_ingredient = "default:grass_1" + dry_shrub_ingredient = "default:dry_shrub" + junglegrass_ingredient = "default:junglegrass" + cactus_ingredient = "default:cactus" + geranium_ingredient = "flowers:geranium" + dandelion_white_ingredient = "flowers:dandelion_white" + dandelion_yellow_ingredient = "flowers:dandelion_yellow" + tulip_ingredient = "flowers:tulip" + rose_ingredient = "flowers:rose" + viola_ingredient = "flowers:viola" +end + +-- Dye Output Variables + +if minetest.get_modpath("mcl_core") then + -- MineClone2 dye names + dye_black = "mcl_dye:black" + dye_violet = "mcl_dye:violet" + dye_green = "mcl_dye:green" + dye_brown = "mcl_dye:brown" + dye_blue = "mcl_dye:blue" + dye_white = "mcl_dye:white" + dye_yellow = "mcl_dye:yellow" + dye_orange = "mcl_dye:orange" + dye_red = "mcl_dye:red" +else + -- Default Minetest Game dye names + dye_black = "dye:black" + dye_violet = "dye:violet" + dye_green = "dye:green" + dye_brown = "dye:brown" + dye_blue = "dye:blue" + dye_white = "dye:white" + dye_yellow = "dye:yellow" + dye_orange = "dye:orange" + dye_red = "dye:red" +end + +dirt_with_snow_ingrediant = nil +if minetest.get_modpath("mcl_core") then + dirt_with_snow_ingrediant = "mcl_core:dirt_with_grass_snow" +else + dirt_with_snow_ingrediant = "default:dirt_with_snow" +end + +bucket_lava_ingrediant = nil +if minetest.get_modpath("mcl_core") then + bucket_lava_ingrediant = "mcl_buckets:bucket_lava" +else + bucket_lava_ingrediant = "bucket:bucket_lava" +end + +bucket_river_water_ingrediant = nil +if minetest.get_modpath("mcl_core") then + bucket_river_water_ingrediant = "mcl_buckets:bucket_river_water" +else + bucket_river_water_ingrediant = "bucket:bucket_river_water" +end + + + if not minetest.get_translator then error("[technic] Your Minetest version is no longer supported." .. " (version < 5.0.0)") diff --git a/technic/machines/HV/quarry.lua b/technic/machines/HV/quarry.lua index 7129030..28d273b 100644 --- a/technic/machines/HV/quarry.lua +++ b/technic/machines/HV/quarry.lua @@ -229,7 +229,7 @@ local function send_move_error(player) return 0 end -local quarry_pick = nill +local quarry_pick = nil if minetest.get_modpath("mcl_core") then quarry_pick = "default_tool_diamondpick.png" else diff --git a/technic/machines/LV/electric_furnace.lua b/technic/machines/LV/electric_furnace.lua index 768f04a..61dc9cc 100644 --- a/technic/machines/LV/electric_furnace.lua +++ b/technic/machines/LV/electric_furnace.lua @@ -5,9 +5,9 @@ minetest.register_craft({ output = 'technic:electric_furnace', recipe = { - {'default:cobble', 'default:cobble', 'default:cobble'}, - {'default:cobble', 'technic:machine_casing', 'default:cobble'}, - {'default:cobble', 'technic:lv_cable', 'default:cobble'}, + {cobble_ingrediant, cobble_ingrediant, cobble_ingrediant}, + {cobble_ingrediant, 'technic:machine_casing', cobble_ingrediant}, + {cobble_ingrediant, 'technic:lv_cable', cobble_ingrediant}, } }) diff --git a/technic/machines/register/alloy_recipes.lua b/technic/machines/register/alloy_recipes.lua index eeee442..0566782 100644 --- a/technic/machines/register/alloy_recipes.lua +++ b/technic/machines/register/alloy_recipes.lua @@ -13,7 +13,7 @@ end local recipes = { {"technic:copper_dust 7", "technic:tin_dust", "technic:bronze_dust 8", 12}, - {"copper_ingrediant 7", "default:tin_ingot", "default:bronze_ingot 8", 12}, + {copper_ingrediant.." 7", tin_ingrediant, bronze_ingrediant.." 8", 12}, {"technic:wrought_iron_dust 2", "technic:coal_dust", "technic:carbon_steel_dust 2", 6}, {"technic:wrought_iron_ingot 2", "technic:coal_dust", "technic:carbon_steel_ingot 2", 6}, {"technic:carbon_steel_dust 2", "technic:coal_dust", "technic:cast_iron_dust 2", 6}, @@ -21,14 +21,14 @@ local recipes = { {"technic:carbon_steel_dust 4", "technic:chromium_dust", "technic:stainless_steel_dust 5", 7.5}, {"technic:carbon_steel_ingot 4", "technic:chromium_ingot", "technic:stainless_steel_ingot 5", 7.5}, {"technic:copper_dust 2", "technic:zinc_dust", "technic:brass_dust 3"}, - {"copper_ingrediant 2", "technic:zinc_ingot", "basic_materials:brass_ingot 3"}, - {"default:sand 2", "technic:coal_dust 2", "technic:silicon_wafer"}, + {copper_ingrediant.." 2", "technic:zinc_ingot", "basic_materials:brass_ingot 3"}, + {sand_ingrediant.." 2", "technic:coal_dust 2", "technic:silicon_wafer"}, {"technic:silicon_wafer", "technic:gold_dust", "technic:doped_silicon_wafer"}, -- from https://en.wikipedia.org/wiki/Carbon_black -- The highest volume use of carbon black is as a reinforcing filler in rubber products, especially tires. -- "[Compounding a] pure gum vulcanizate … with 50% of its weight of carbon black improves its tensile strength and wear resistance …" {"technic:raw_latex 4", "technic:coal_dust 2", "technic:rubber 6", 2}, - {"default:ice", "bucket:bucket_empty", "bucket:bucket_water", 1 }, + {ice_block_ingrediant, emtpy_bucket_ingrediant, water_bucket_ingrediant, 1 }, } for _, data in pairs(recipes) do diff --git a/technic/machines/register/centrifuge_recipes.lua b/technic/machines/register/centrifuge_recipes.lua index 11c6788..e9dd265 100644 --- a/technic/machines/register/centrifuge_recipes.lua +++ b/technic/machines/register/centrifuge_recipes.lua @@ -14,8 +14,8 @@ local recipes = { { "technic:bronze_dust 8", "technic:copper_dust 7", "technic:tin_dust" }, { "technic:stainless_steel_dust 5", "technic:wrought_iron_dust 4", "technic:chromium_dust" }, { "technic:brass_dust 3", "technic:copper_dust 2", "technic:zinc_dust" }, - { "technic:chernobylite_dust", "default:sand", "technic:uranium3_dust" }, - { "default:dirt 4", "default:sand", "default:gravel", "default:clay_lump 2" }, + { "technic:chernobylite_dust", sand_ingrediant, "technic:uranium3_dust" }, + { dirt_ingrediant.." 4", sand_ingrediant, gravel_ingrediant, "default:clay_lump 2" }, } local function uranium_dust(p) diff --git a/technic/machines/register/extractor_recipes.lua b/technic/machines/register/extractor_recipes.lua index ba43df5..9975795 100644 --- a/technic/machines/register/extractor_recipes.lua +++ b/technic/machines/register/extractor_recipes.lua @@ -13,22 +13,25 @@ if minetest.get_modpath("dye") then local unifieddyes = minetest.get_modpath("unifieddyes") -- register recipes with the same crafting ratios as `dye` provides + local dye_recipes = { - {"technic:coal_dust", "dye:black 2"}, - {"default:blueberries", "dye:violet 2"}, - {"default:grass_1", "dye:green 1"}, - {"default:dry_shrub", "dye:brown 1"}, - {"default:junglegrass", "dye:green 2"}, - {"default:cactus", "dye:green 4"}, - {"flowers:geranium", "dye:blue 4"}, - {"flowers:dandelion_white", "dye:white 4"}, - {"flowers:dandelion_yellow", "dye:yellow 4"}, - {"flowers:tulip", "dye:orange 4"}, - {"flowers:rose", "dye:red 4"}, - {"flowers:viola", "dye:violet 4"}, - {"bushes:blackberry", unifieddyes and "unifieddyes:magenta_s50 4" or "dye:violet 4"}, - {"bushes:blueberry", unifieddyes and "unifieddyes:magenta_s50 4" or "dye:magenta 4"}, + {"technic:coal_dust", dye_black .. " 2"}, + {blueberries_ingredient, dye_violet .. " 2"}, + {grass_ingredient, dye_green .. " 1"}, + {dry_shrub_ingredient, dye_brown .. " 1"}, + {junglegrass_ingredient, dye_green .. " 2"}, + {cactus_ingredient, dye_green .. " 4"}, + {geranium_ingredient, dye_blue .. " 4"}, + {dandelion_white_ingredient, dye_white .. " 4"}, + {dandelion_yellow_ingredient, dye_yellow .. " 4"}, + {tulip_ingredient, dye_orange .. " 4"}, + {rose_ingredient, dye_red .. " 4"}, + {viola_ingredient, dye_violet .. " 4"}, + {blackberry_ingredient, unifieddyes and "unifieddyes:magenta_s50 4" or dye_violet .. " 4"}, + {blueberry_ingredient, unifieddyes and "unifieddyes:magenta_s50 4" or dye_magenta .. " 4"}, } + + for _, data in ipairs(dye_recipes) do technic.register_extractor_recipe({input = {data[1]}, output = data[2]}) diff --git a/technic/machines/register/freezer_recipes.lua b/technic/machines/register/freezer_recipes.lua index 641b28a..59d6166 100644 --- a/technic/machines/register/freezer_recipes.lua +++ b/technic/machines/register/freezer_recipes.lua @@ -9,10 +9,10 @@ function technic.register_freezer_recipe(data) end local recipes = { - {"bucket:bucket_water", { "default:ice", "bucket:bucket_empty" } }, - {"bucket:bucket_river_water", { "default:ice", "bucket:bucket_empty" } }, - {"default:dirt", "default:dirt_with_snow" }, - {"bucket:bucket_lava", { "default:obsidian", "bucket:bucket_empty" } } + {water_bucket_ingrediant, { ice_block_ingrediant, emtpy_bucket_ingrediant } }, + {bucket_river_water_ingrediant, { ice_block_ingrediant, emtpy_bucket_ingrediant } }, + {dirt_ingrediant , dirt_with_snow_ingrediant }, + {bucket_lava_ingrediant, { obsidian_ingrediant, emtpy_bucket_ingrediant } } } for _, data in pairs(recipes) do diff --git a/technic/machines/register/grinder_recipes.lua b/technic/machines/register/grinder_recipes.lua index 0a13a29..e1474d5 100644 --- a/technic/machines/register/grinder_recipes.lua +++ b/technic/machines/register/grinder_recipes.lua @@ -9,33 +9,36 @@ function technic.register_grinder_recipe(data) end local recipes = { - -- Dusts - {"default:coal_lump", "technic:coal_dust 2"}, - {"default:copper_lump", "technic:copper_dust 2"}, - {"default:desert_stone", "default:desert_sand"}, - {"default:gold_lump", "technic:gold_dust 2"}, - {"default:iron_lump", "technic:wrought_iron_dust 2"}, - {"default:tin_lump", "technic:tin_dust 2"}, - {"technic:chromium_lump", "technic:chromium_dust 2"}, - {"technic:uranium_lump", "technic:uranium_dust 2"}, - {"technic:zinc_lump", "technic:zinc_dust 2"}, - {"technic:lead_lump", "technic:lead_dust 2"}, - {"technic:sulfur_lump", "technic:sulfur_dust 2"}, - {"default:stone", "technic:stone_dust"}, - {"default:sand", "technic:stone_dust"}, - {"default:desert_sand", "technic:stone_dust"}, - {"default:silver_sand", "technic:stone_dust"}, + -- Dusts + {coal_ingrediant, "technic:coal_dust 2"}, + {copper_lump_ingrediant, "technic:copper_dust 2"}, + {desert_stone_ingrediant, desert_sand_ingrediant}, + {gold_lump_ingrediant, "technic:gold_dust 2"}, + {iron_lump_ingrediant, "technic:wrought_iron_dust 2"}, + {"moreores:tin_lump", "technic:tin_dust 2"}, + {"technic:chromium_lump", "technic:chromium_dust 2"}, + {"technic:uranium_lump", "technic:uranium_dust 2"}, + {"technic:zinc_lump", "technic:zinc_dust 2"}, + {"technic:lead_lump", "technic:lead_dust 2"}, + {"technic:sulfur_lump", "technic:sulfur_dust 2"}, + {stone_ingrediant, "technic:stone_dust"}, + {sand_ingrediant, "technic:stone_dust"}, + {desert_sand_ingrediant, "technic:stone_dust"}, - -- Other - {"default:cobble", "default:gravel"}, - {"default:gravel", "default:sand"}, - {"default:sandstone", "default:sand 2"}, -- reverse recipe can be found in the compressor - {"default:desert_sandstone", "default:desert_sand 2"}, -- reverse recipe can be found in the compressor - {"default:silver_sandstone", "default:silver_sand 2"}, -- reverse recipe can be found in the compressor - - {"default:ice", "default:snowblock"}, + -- Other + {cobble_ingrediant, gravel_ingrediant}, + {gravel_ingrediant, sand_ingrediant}, + {sandstone_ingrediant, sand_ingrediant.." 2"}, -- reverse recipe can be found in the compressor + {desert_stone_ingrediant, desert_sand_ingrediant.." 2"}, -- reverse recipe can be found in the compressor + {ice_block_ingrediant, snow_block_ingrediant}, } + +if minetest.get_modpath("default") then + table.insert(recipes, {"default:silver_sandstone", "default:silver_sand 2"}) -- reverse recipe can be found in the compressor + table.insert(recipes, {"default:silver_sand", "technic:stone_dust"}) +end + -- defuse the sandstone -> 4 sand recipe to avoid infinite sand bugs (also consult the inverse compressor recipe) minetest.clear_craft({ recipe = { @@ -87,11 +90,13 @@ local function register_dust(name, ingot) inventory_image = "technic_"..lname.."_dust.png", }) if ingot then - minetest.register_craft({ + data1 = { type = "cooking", recipe = "technic:"..lname.."_dust", output = ingot, - }) + } + minetest.log("action",minetest.serialize(data1)) + minetest.register_craft(data1) technic.register_grinder_recipe({ input = {ingot}, output = "technic:"..lname.."_dust 1" }) end end @@ -112,7 +117,7 @@ register_dust("Silver", "moreores:silver_ingot") register_dust("Stainless Steel", "technic:stainless_steel_ingot") register_dust("Stone", "default:stone") register_dust("Sulfur", nil) -register_dust("Tin", "default:tin_ingot") +register_dust("Tin", tin_ingrediant) register_dust("Wrought Iron", "technic:wrought_iron_ingot") register_dust("Zinc", "technic:zinc_ingot") if minetest.get_modpath("gloopores") or minetest.get_modpath("glooptest") then