From d5ff69d1d9efd683d852562af6cfddac5ac69879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1briel?= <38207624+gabriel1379@users.noreply.github.com> Date: Mon, 25 Mar 2024 19:45:57 +0100 Subject: [PATCH] Add Everness sandstone compressor recipes (#634) --- .../machines/register/compressor_recipes.lua | 68 +++++++++++++------ technic/machines/register/grinder_recipes.lua | 20 ++++++ technic/mod.conf | 2 +- 3 files changed, 70 insertions(+), 20 deletions(-) diff --git a/technic/machines/register/compressor_recipes.lua b/technic/machines/register/compressor_recipes.lua index acb9eca..ad09868 100644 --- a/technic/machines/register/compressor_recipes.lua +++ b/technic/machines/register/compressor_recipes.lua @@ -21,27 +21,57 @@ local recipes = { {"technic:uranium35_ingot 5", "technic:uranium_fuel"}, } +if minetest.get_modpath("everness") then + local everness_sand_to_sandstone_recipes = { + {"everness:coral_deep_ocean_sand 2", "everness:coral_deep_ocean_sandstone_block"}, + {"everness:coral_sand 2", "everness:coral_sandstone"}, + {"everness:coral_white_sand 2", "everness:coral_white_sandstone"}, + {"everness:crystal_forest_deep_ocean_sand 2", "everness:crystal_forest_deep_ocean_sandstone_block"}, + {"everness:crystal_sand 2", "everness:crystal_sandstone"}, + {"everness:cursed_lands_deep_ocean_sand 2", "everness:cursed_lands_deep_ocean_sandstone_block"}, + {"everness:cursed_sand 2", "everness:cursed_sandstone_block"}, + {"everness:mineral_sand 2", "everness:mineral_sandstone"}, + } + + for _, data in ipairs(everness_sand_to_sandstone_recipes) do + table.insert(recipes, {data[1], data[2]}) + end +end + -- defuse the default sandstone recipe, since we have the compressor to take over in a more realistic manner -minetest.clear_craft({ - recipe = { - {"default:sand", "default:sand"}, - {"default:sand", "default:sand"}, - }, -}) -minetest.clear_craft({ - recipe = { - {"default:desert_sand", "default:desert_sand"}, - {"default:desert_sand", "default:desert_sand"}, - }, -}) -minetest.clear_craft({ - recipe = { - {"default:silver_sand", "default:silver_sand"}, - {"default:silver_sand", "default:silver_sand"}, - }, -}) +local crafts_to_clear = { + "default:desert_sand", + "default:sand", + "default:silver_sand" +} + +if minetest.get_modpath("everness") then + local everness_crafts_to_clear = { + "everness:coral_sand", + "everness:coral_forest_deep_ocean_sand", + "everness:coral_white_sand", + "everness:crystal_sand", + "everness:cursed_sand", + "everness:cursed_lands_deep_ocean_sand", + "everness:crystal_forest_deep_ocean_sand", + "everness:mineral_sand", + } + + for _, sand_name in ipairs(everness_crafts_to_clear) do + table.insert(crafts_to_clear, sand_name) + end +end + +for _, sand_name in ipairs(crafts_to_clear) do + minetest.clear_craft({ + type = "shaped", + recipe = { + {sand_name, sand_name}, + {sand_name, sand_name}, + }, + }) +end for _, data in pairs(recipes) do technic.register_compressor_recipe({input = {data[1]}, output = data[2]}) end - diff --git a/technic/machines/register/grinder_recipes.lua b/technic/machines/register/grinder_recipes.lua index df8061a..f511ef5 100644 --- a/technic/machines/register/grinder_recipes.lua +++ b/technic/machines/register/grinder_recipes.lua @@ -36,6 +36,17 @@ 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"}) +end + -- defuse the sandstone -> 4 sand recipe to avoid infinite sand bugs (also consult the inverse compressor recipe) minetest.clear_craft({ recipe = { @@ -53,6 +64,15 @@ minetest.clear_craft({ }, }) +if minetest.get_modpath("everness") then + minetest.clear_craft({ + 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 diff --git a/technic/mod.conf b/technic/mod.conf index 736eff3..71062ab 100644 --- a/technic/mod.conf +++ b/technic/mod.conf @@ -1,3 +1,3 @@ name = technic depends = default, pipeworks, technic_worldgen, basic_materials -optional_depends = bucket, screwdriver, mesecons, mesecons_mvps, digilines, digiline_remote, intllib, unified_inventory, vector_extras, dye, craftguide, i3 +optional_depends = bucket, screwdriver, mesecons, mesecons_mvps, digilines, digiline_remote, intllib, unified_inventory, vector_extras, dye, craftguide, i3, everness