From 80dee96dbe2662d4ec6f389faafaf9890855000e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1briel?= <38207624+gabriel1379@users.noreply.github.com> Date: Mon, 6 May 2024 17:33:22 +0200 Subject: [PATCH] Add grinding recipe for nether lump + refactor grinder recipes (#638) Maintenance: * Sort dependency-based entries alphabetically * Refactor dust registration Features: * Add grinding recipe for nether lump and ingot + image for nether dust --- technic/machines/register/grinder_recipes.lua | 174 ++++++++++-------- technic/textures/technic_nether_dust.png | Bin 0 -> 207 bytes 2 files changed, 98 insertions(+), 76 deletions(-) create mode 100644 technic/textures/technic_nether_dust.png diff --git a/technic/machines/register/grinder_recipes.lua b/technic/machines/register/grinder_recipes.lua index f511ef5..c0e5540 100644 --- a/technic/machines/register/grinder_recipes.lua +++ b/technic/machines/register/grinder_recipes.lua @@ -36,73 +36,73 @@ local recipes = { {"default:ice", "default:snowblock"}, } -if minetest.get_modpath("everness") then - table.insert(recipes, {"everness:coral_deep_ocean_sandstone_block", "everness:coral_deep_ocean_sand 2"}) - table.insert(recipes, {"everness:coral_sandstone", "everness:coral_sand 2"}) - table.insert(recipes, {"everness:coral_white_sandstone", "everness:coral_white_sand 2"}) - table.insert(recipes, {"everness:crystal_forest_deep_ocean_sandstone_block", "everness:crystal_forest_deep_ocean_sand 2"}) - table.insert(recipes, {"everness:crystal_sandstone", "everness:crystal_sand 2"}) - table.insert(recipes, {"everness:cursed_lands_deep_ocean_sandstone_block", "everness:cursed_lands_deep_ocean_sand 2"}) - table.insert(recipes, {"everness:cursed_sandstone_block", "everness:cursed_sand 2"}) - table.insert(recipes, {"everness:mineral_sandstone", "everness:mineral_sand 2"}) +local dependent_recipes = { + -- Sandstones + everness = { + {"everness:coral_deep_ocean_sandstone_block", "everness:coral_deep_ocean_sand 2"}, + {"everness:coral_sandstone", "everness:coral_sand 2"}, + {"everness:coral_white_sandstone", "everness:coral_white_sand 2"}, + {"everness:crystal_forest_deep_ocean_sandstone_block", "everness:crystal_forest_deep_ocean_sand 2"}, + {"everness:crystal_sandstone", "everness:crystal_sand 2"}, + {"everness:cursed_lands_deep_ocean_sandstone_block", "everness:cursed_lands_deep_ocean_sand 2"}, + {"everness:cursed_sandstone_block", "everness:cursed_sand 2"}, + {"everness:mineral_sandstone", "everness:mineral_sand 2"}, + -- Lumps and wheat + {"everness:pyrite_lump", "technic:pyrite_dust 2"}, + }, + farming = { + {"farming:seed_wheat", "farming:flour 1"}, + }, + gloopores = { + {"gloopores:alatro_lump", "technic:alatro_dust 2"}, + {"gloopores:kalite_lump", "technic:kalite_dust 2"}, + {"gloopores:arol_lump", "technic:arol_dust 2"}, + {"gloopores:talinite_lump", "technic:talinite_dust 2"}, + {"gloopores:akalin_lump", "technic:akalin_dust 2"}, + }, + homedecor = { + {"home_decor:brass_ingot", "technic:brass_dust 1"}, + }, + moreores = { + {"moreores:mithril_lump", "technic:mithril_dust 2"}, + {"moreores:silver_lump", "technic:silver_dust 2"}, + }, + nether = { + {"nether:nether_lump", "technic:nether_dust 2"}, + }, +} + +for dependency, materials_to_add in pairs(dependent_recipes) do + if minetest.get_modpath(dependency) then + for _, material_entry in ipairs(materials_to_add) do + table.insert(recipes, material_entry) + end + end end -- defuse the sandstone -> 4 sand recipe to avoid infinite sand bugs (also consult the inverse compressor recipe) minetest.clear_craft({ - recipe = { - {"default:sandstone"} - }, + recipe = {{"default:sandstone"}}, }) minetest.clear_craft({ - recipe = { - {"default:desert_sandstone"} - }, + recipe = {{"default:desert_sandstone"}}, }) minetest.clear_craft({ - recipe = { - {"default:silver_sandstone"} - }, + recipe = {{"default:silver_sandstone"}}, }) if minetest.get_modpath("everness") then minetest.clear_craft({ - recipe = { - {"everness:mineral_sandstone"} - }, + recipe = {{"everness:mineral_sandstone"}}, }) -- Currently (2024-03-09), there seem to be no reverse recipes for any of the other everness sandstones. end -if minetest.get_modpath("farming") then - table.insert(recipes, {"farming:seed_wheat", "farming:flour 1"}) -end - -if minetest.get_modpath("moreores") then - table.insert(recipes, {"moreores:mithril_lump", "technic:mithril_dust 2"}) - table.insert(recipes, {"moreores:silver_lump", "technic:silver_dust 2"}) -end - -if minetest.get_modpath("gloopores") or minetest.get_modpath("glooptest") then - table.insert(recipes, {"gloopores:alatro_lump", "technic:alatro_dust 2"}) - table.insert(recipes, {"gloopores:kalite_lump", "technic:kalite_dust 2"}) - table.insert(recipes, {"gloopores:arol_lump", "technic:arol_dust 2"}) - table.insert(recipes, {"gloopores:talinite_lump", "technic:talinite_dust 2"}) - table.insert(recipes, {"gloopores:akalin_lump", "technic:akalin_dust 2"}) -end - -if minetest.get_modpath("homedecor") then - table.insert(recipes, {"home_decor:brass_ingot", "technic:brass_dust 1"}) -end - -if minetest.get_modpath("everness") then - table.insert(recipes, {"everness:pyrite_lump", "technic:pyrite_dust 2"}) -end - -for _, data in pairs(recipes) do +for _, data in ipairs(recipes) do technic.register_grinder_recipe({input = {data[1]}, output = data[2]}) end --- dusts +-- Dusts local function register_dust(name, ingot) local lname = string.lower(name) lname = string.gsub(lname, ' ', '_') @@ -120,36 +120,57 @@ local function register_dust(name, ingot) end end --- Sorted alphibeticaly -register_dust("Brass", "basic_materials:brass_ingot") -register_dust("Bronze", "default:bronze_ingot") -register_dust("Carbon Steel", "technic:carbon_steel_ingot") -register_dust("Cast Iron", "technic:cast_iron_ingot") -register_dust("Chernobylite", "technic:chernobylite_block") -register_dust("Chromium", "technic:chromium_ingot") -register_dust("Coal", nil) -register_dust("Copper", "default:copper_ingot") -register_dust("Lead", "technic:lead_ingot") -register_dust("Gold", "default:gold_ingot") -register_dust("Mithril", "moreores:mithril_ingot") -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("Wrought Iron", "technic:wrought_iron_ingot") -register_dust("Zinc", "technic:zinc_ingot") -if minetest.get_modpath("gloopores") or minetest.get_modpath("glooptest") then - register_dust("Akalin", "glooptest:akalin_ingot") - register_dust("Alatro", "glooptest:alatro_ingot") - register_dust("Arol", "glooptest:arol_ingot") - register_dust("Kalite", nil) - register_dust("Talinite", "glooptest:talinite_ingot") -end -if minetest.get_modpath("everness") then - register_dust("Pyrite", "everness:pyrite_ingot") +-- Sorted alphabetically +local dusts = { + {"Brass", "basic_materials:brass_ingot"}, + {"Bronze", "default:bronze_ingot"}, + {"Carbon Steel", "technic:carbon_steel_ingot"}, + {"Cast Iron", "technic:cast_iron_ingot"}, + {"Chernobylite", "technic:chernobylite_block"}, + {"Chromium", "technic:chromium_ingot"}, + {"Coal", nil}, + {"Copper", "default:copper_ingot"}, + {"Lead", "technic:lead_ingot"}, + {"Gold", "default:gold_ingot"}, + {"Mithril", "moreores:mithril_ingot"}, + {"Silver", "moreores:silver_ingot"}, + {"Stainless Steel", "technic:stainless_steel_ingot"}, + {"Stone", "default:stone"}, + {"Sulfur", nil}, + {"Tin", "default:tin_ingot"}, + {"Wrought Iron", "technic:wrought_iron_ingot"}, + {"Zinc", "technic:zinc_ingot"}, +} + +local dependent_dusts = { + everness = { + {"Pyrite", "everness:pyrite_ingot"}, + }, + gloopores = { + {"Akalin", "glooptest:akalin_ingot"}, + {"Alatro", "glooptest:alatro_ingot"}, + {"Arol", "glooptest:arol_ingot"}, + {"Kalite", nil}, + {"Talinite", "glooptest:talinite_ingot"}, + }, + nether = { + {"Nether", "nether:nether_ingot"}, + }, +} + +for dependency, dusts_to_add in pairs(dependent_dusts) do + if minetest.get_modpath(dependency) then + for _, dust_entry in pairs(dusts_to_add) do + table.insert(dusts, dust_entry) + end + end end +for _, data in ipairs(dusts) do + register_dust(data[1], data[2]) +end + +-- Uranium for p = 0, 35 do local nici = (p ~= 0 and p ~= 7 and p ~= 35) and 1 or nil local psuffix = p == 7 and "" or p @@ -185,6 +206,7 @@ for pa = 0, 34 do end end +-- Fuels minetest.register_craft({ type = "fuel", recipe = "technic:coal_dust", diff --git a/technic/textures/technic_nether_dust.png b/technic/textures/technic_nether_dust.png new file mode 100644 index 0000000000000000000000000000000000000000..94a1267821615a041e6b4ff7331b1daa1db45d94 GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`(>z@qLo80e?K#WUuyLYzr+-rTCYo=tv^Um5snKE$TUEML6%v3B874nL;at4Det z