From 420e63e7a6a48fd5425430de0bf85afd0c291847 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Thu, 21 Dec 2023 07:59:12 +0000 Subject: [PATCH] Ores now generate correctly in technic --- .../machines/register/extractor_recipes.lua | 2 +- technic/machines/register/grinder_recipes.lua | 6 +-- technic_worldgen/nodes.lua | 30 ++++++++++--- technic_worldgen/oregen.lua | 44 ++++++++++++++----- 4 files changed, 61 insertions(+), 21 deletions(-) diff --git a/technic/machines/register/extractor_recipes.lua b/technic/machines/register/extractor_recipes.lua index 9975795..6885750 100644 --- a/technic/machines/register/extractor_recipes.lua +++ b/technic/machines/register/extractor_recipes.lua @@ -28,7 +28,7 @@ if minetest.get_modpath("dye") then {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"}, + {blueberry_ingredient, unifieddyes and "unifieddyes:magenta_s50 4" or ""}, } diff --git a/technic/machines/register/grinder_recipes.lua b/technic/machines/register/grinder_recipes.lua index e1474d5..8087cd7 100644 --- a/technic/machines/register/grinder_recipes.lua +++ b/technic/machines/register/grinder_recipes.lua @@ -90,13 +90,11 @@ local function register_dust(name, ingot) inventory_image = "technic_"..lname.."_dust.png", }) if ingot then - data1 = { + minetest.register_craft({ 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 diff --git a/technic_worldgen/nodes.lua b/technic_worldgen/nodes.lua index c5a55a1..6930874 100644 --- a/technic_worldgen/nodes.lua +++ b/technic_worldgen/nodes.lua @@ -5,45 +5,65 @@ minetest.register_node( ":technic:mineral_uranium", { description = S("Uranium Ore"), tiles = { "default_stone.png^technic_mineral_uranium.png" }, is_ground_content = true, - groups = {cracky=3, radioactive=1}, + groups = {cracky=3, radioactive=1,pickaxey=5,material_stone=1}, sounds = stone_sounds, drop = "technic:uranium_lump", + _mcl_hardness = 5, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node( ":technic:mineral_chromium", { description = S("Chromium Ore"), tiles = { "default_stone.png^technic_mineral_chromium.png" }, is_ground_content = true, - groups = {cracky=3}, + groups = {cracky=3,pickaxey=3,material_stone=1}, sounds = stone_sounds, drop = "technic:chromium_lump", + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node( ":technic:mineral_zinc", { description = S("Zinc Ore"), tiles = { "default_stone.png^technic_mineral_zinc.png" }, is_ground_content = true, - groups = {cracky=3}, + groups = {cracky=3,pickaxey=2,material_stone=1}, sounds = stone_sounds, drop = "technic:zinc_lump", + _mcl_hardness = 2, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node( ":technic:mineral_lead", { description = S("Lead Ore"), tiles = { "default_stone.png^technic_mineral_lead.png" }, is_ground_content = true, - groups = {cracky=3}, + groups = {cracky=3,pickaxey=2,material_stone=1}, sounds = stone_sounds, drop = "technic:lead_lump", + _mcl_hardness = 2, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node( ":technic:mineral_sulfur", { description = S("Sulfur Ore"), tiles = { "default_stone.png^technic_mineral_sulfur.png" }, is_ground_content = true, - groups = {cracky=3}, + groups = {cracky=3,pickaxey=1,material_stone=1}, sounds = stone_sounds, drop = "technic:sulfur_lump", + _mcl_hardness = 1, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) if minetest.get_modpath("default") then diff --git a/technic_worldgen/oregen.lua b/technic_worldgen/oregen.lua index a7f55be..6a93ffd 100644 --- a/technic_worldgen/oregen.lua +++ b/technic_worldgen/oregen.lua @@ -37,10 +37,32 @@ local lead_params = { persist = 0.7 } local lead_threshold = 0.3 +local mcl_core_modpath = minetest.get_modpath("mcl_core") +local stone_id = mcl_core_modpath and "mcl_core:stone" or "default:stone" +local lava_source_id = mcl_core_modpath and "mcl_core:lava_source" or "default:lava_source" +local lava_flowing_id = mcl_core_modpath and "mcl_core:lava_flowing" or "default:lava_flowing" -local stone_id = minetest.get_modpath("mcl_core") and "mcl_core:stone" or "default:stone" -local lava_source_id = minetest.get_modpath("mcl_core") and "mcl_core:lava_source" or "default:lava_source" -local lava_flowing_id = minetest.get_modpath("mcl_core") and "mcl_core:lava_flowing" or "default:lava_flowing" +-- Define default values for y_min and y_max +local uranium_y_min = -300 +local uranium_y_max = -80 +local chromium_y_min = -200 +local chromium_y_max = -100 +local zinc_y_min = -32 +local zinc_y_max = 2 +local lead_y_min = -16 +local lead_y_max = 16 + +-- Update values if MineClone2 is detected +if mcl_core_modpath then + uranium_y_min = -57 + uranium_y_max = 100 + chromium_y_min = -57 + chromium_y_max = 100 + zinc_y_min = -57 + zinc_y_max = 100 + lead_y_min = -57 + lead_y_max = 100 +end -- Uranium minetest.register_ore({ @@ -50,8 +72,8 @@ minetest.register_ore({ clust_scarcity = 8*8*8, clust_num_ores = 4, clust_size = 3, - y_min = -300, - y_max = -80, + y_min = uranium_y_min, + y_max = uranium_y_max, noise_params = uranium_params, noise_threshold = uranium_threshold, }) @@ -64,8 +86,8 @@ minetest.register_ore({ clust_scarcity = 8*8*8, clust_num_ores = 2, clust_size = 3, - y_min = -200, - y_max = -100, + y_min = chromium_y_min, + y_max = chromium_y_max, noise_params = chromium_params, noise_threshold = chromium_threshold, }) @@ -78,8 +100,8 @@ minetest.register_ore({ clust_scarcity = 8*8*8, clust_num_ores = 5, clust_size = 7, - y_min = -32, - y_max = 2, + y_min = zinc_y_min, + y_max = zinc_y_max, noise_params = zinc_params, noise_threshold = zinc_threshold, }) @@ -92,8 +114,8 @@ minetest.register_ore({ clust_scarcity = 9*9*9, clust_num_ores = 5, clust_size = 3, - y_min = -16, - y_max = 16, + y_min = lead_y_min, + y_max = lead_y_max, noise_params = lead_params, noise_threshold = lead_threshold, })