From cfe2ee21330265dd68409d97e1a880ab310f71a0 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Wed, 20 Dec 2023 08:20:56 +0000 Subject: [PATCH 01/32] Added Mineclone2 support apart from special machines own recipes within the machines --- concrete/init.lua | 27 +- concrete/mod.conf | 4 +- extranodes/init.lua | 52 ++- extranodes/mod.conf | 5 +- technic/crafts.lua | 46 +-- technic/init.lua | 269 +++++++++++++++ technic/items.lua | 4 +- technic/machines/HV/forcefield.lua | 6 +- technic/machines/HV/nuclear_reactor.lua | 6 +- technic/machines/HV/quarry.lua | 9 +- technic/machines/LV/alloy_furnace.lua | 6 +- technic/machines/LV/cables.lua | 6 +- technic/machines/LV/compressor.lua | 2 +- technic/machines/LV/generator.lua | 6 +- technic/machines/LV/geothermal.lua | 8 +- technic/machines/LV/grinder.lua | 6 +- technic/machines/LV/lamp.lua | 2 +- technic/machines/LV/music_player.lua | 8 +- technic/machines/LV/solar_panel.lua | 2 +- technic/machines/LV/water_mill.lua | 6 +- technic/machines/MV/hydro_turbine.lua | 4 +- technic/machines/MV/lighting.lua | 24 +- technic/machines/MV/power_radiator.lua | 2 +- technic/machines/MV/tool_workshop.lua | 6 +- technic/machines/MV/wind_mill.lua | 4 +- technic/machines/other/anchor.lua | 2 +- technic/machines/other/coal_alloy_furnace.lua | 10 +- technic/machines/other/coal_furnace.lua | 5 + technic/machines/other/constructor.lua | 4 +- technic/machines/other/frames.lua | 4 +- technic/machines/other/injector.lua | 4 +- technic/machines/power_monitor.lua | 4 +- technic/machines/register/alloy_recipes.lua | 4 +- technic/machines/register/battery_box.lua | 6 +- technic/machines/register/cables.lua | 4 +- technic/machines/register/common.lua | 4 +- .../machines/register/compressor_recipes.lua | 15 +- technic/machines/register/generator.lua | 4 +- technic/machines/register/grinder_recipes.lua | 4 +- technic/machines/register/machine_base.lua | 4 +- technic/machines/register/solar_array.lua | 2 +- technic/machines/supply_converter.lua | 2 +- technic/machines/switching_station.lua | 4 +- technic/mod.conf | 5 +- technic/radiation.lua | 8 +- technic/tools/cans.lua | 4 +- technic/tools/chainsaw.lua | 8 +- technic/tools/mining_drill.lua | 4 +- technic/tools/mining_lasers.lua | 12 +- technic/tools/sonic_screwdriver.lua | 6 +- technic/tools/tree_tap.lua | 4 +- technic_chests/copper_chest.lua | 12 +- technic_chests/gold_chest.lua | 12 +- technic_chests/init.lua | 59 ++++ technic_chests/iron_chest.lua | 4 +- technic_chests/mod.conf | 5 +- technic_chests/register.lua | 2 +- technic_cnc/cnc.lua | 6 +- technic_cnc/cnc_materials.lua | 205 ++++++----- technic_cnc/mod.conf | 5 +- technic_worldgen/crafts.lua | 12 + technic_worldgen/init.lua | 29 ++ technic_worldgen/mod.conf | 5 +- technic_worldgen/nodes.lua | 46 ++- technic_worldgen/oregen.lua | 324 ++++++++---------- technic_worldgen/rubber.lua | 8 +- wrench/mod.conf | 4 +- wrench/support.lua | 2 +- 68 files changed, 902 insertions(+), 495 deletions(-) diff --git a/concrete/init.lua b/concrete/init.lua index 82b4098..f186f09 100644 --- a/concrete/init.lua +++ b/concrete/init.lua @@ -4,6 +4,21 @@ local technic = rawget(_G, "technic") or {} technic.concrete_posts = {} +-- Mineclone2 Support +local stone_ingrediant = nil +if minetest.get_modpath("mcl_core") then + stone_ingrediant = "mcl_core:stone" +else + stone_ingrediant = "default:stone" +end + +local stone_sounds = nil +if minetest.get_modpath("mcl_sounds") then + stone_sounds = mcl_sounds.node_sound_stone_defaults() +else + stone_sounds = default.node_sound_stone_defaults() +end + -- Boilerplate to support localized strings if intllib mod is installed. local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end @@ -26,9 +41,9 @@ minetest.register_craft({ minetest.register_craft({ output = 'technic:concrete_post 12', recipe = { - {'default:stone','basic_materials:steel_bar','default:stone'}, - {'default:stone','basic_materials:steel_bar','default:stone'}, - {'default:stone','basic_materials:steel_bar','default:stone'}, + {stone_ingrediant,'basic_materials:steel_bar',stone_ingrediant}, + {stone_ingrediant,'basic_materials:steel_bar',stone_ingrediant}, + {stone_ingrediant,'basic_materials:steel_bar',stone_ingrediant}, } }) @@ -45,7 +60,7 @@ minetest.register_node(":technic:blast_resistant_concrete", { description = S("Blast-resistant Concrete Block"), tiles = {"technic_blast_resistant_concrete_block.png",}, groups = {cracky=1, level=3, concrete=1}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, on_blast = function(pos, intensity) if intensity > 9 then minetest.remove_node(pos) @@ -80,7 +95,7 @@ minetest.register_node(":technic:concrete_post_platform", { description = S("Concrete Post Platform"), tiles = {"basic_materials_concrete_block.png",}, groups={cracky=1, level=2}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, paramtype = "light", drawtype = "nodebox", node_box = { @@ -112,7 +127,7 @@ for platform = 0, 1 do description = S("Concrete Post"), tiles = {"basic_materials_concrete_block.png"}, groups = {cracky=1, level=2, concrete_post=1, not_in_creative_inventory=platform}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, drop = (platform == 1 and "technic:concrete_post_platform" or "technic:concrete_post"), paramtype = "light", diff --git a/concrete/mod.conf b/concrete/mod.conf index 506f906..6f4a76a 100644 --- a/concrete/mod.conf +++ b/concrete/mod.conf @@ -1,3 +1,3 @@ name = concrete -depends = default -optional_depends = basic_materials, intllib, moreblocks +optional_depends = basic_materials, intllib, moreblocks, default +supported_games = minetest_game,mineclone2 \ No newline at end of file diff --git a/extranodes/init.lua b/extranodes/init.lua index 165ba0d..ac4941c 100644 --- a/extranodes/init.lua +++ b/extranodes/init.lua @@ -1,8 +1,25 @@ -- Minetest 0.4.6 mod: extranodes -- namespace: technic -- Boilerplate to support localized strings if intllib mod is installed. + local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end + +-- MineClone2 support +local stone_sounds = nil +if minetest.get_modpath("mcl_sounds") then + stone_sounds = mcl_sounds.node_sound_stone_defaults() +else + stone_sounds = default.node_sound_stone_defaults() +end + +wood_fence_ingrediant = nil +if minetest.get_modpath("mcl_core") then + wood_fence_ingrediant = "group:fence_wood" +else + wood_fence_ingrediant = "default:fence_wood" +end + if minetest.get_modpath("moreblocks") then -- register stairsplus/circular_saw nodes @@ -20,7 +37,7 @@ if minetest.get_modpath("moreblocks") then groups={cracky=3, not_in_creative_inventory=1}, tiles={"technic_marble_bricks.png"}, }) - +if not minetest.get_modpath("mcl_core") then stairsplus:register_all("technic", "granite", "technic:granite", { description=S("Granite"), groups={cracky=1, not_in_creative_inventory=1}, @@ -32,7 +49,7 @@ if minetest.get_modpath("moreblocks") then groups={cracky=1, not_in_creative_inventory=1}, tiles={"technic_granite_bricks.png"}, }) - +end stairsplus:register_all("technic", "concrete", "technic:concrete", { description=S("Concrete"), groups={cracky=3, not_in_creative_inventory=1}, @@ -108,7 +125,9 @@ if minetest.get_modpath("moreblocks") then register_technic_stairs_alias("stairsplus", "concrete", "technic", "concrete") register_technic_stairs_alias("stairsplus", "marble", "technic", "marble") + if not minetest.get_modpath("mcl_core") then register_technic_stairs_alias("stairsplus", "granite", "technic", "granite") + end register_technic_stairs_alias("stairsplus", "marble_bricks", "technic", "marble_bricks") end @@ -120,7 +139,7 @@ local iclip_def = { tiles = {"technic_insulator_clip.png"}, is_ground_content = false, groups = {choppy=1, snappy=1, oddly_breakable_by_hand=1 }, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, } local iclipfence_def = { @@ -154,7 +173,7 @@ local iclipfence_def = { }, connects_to = {"group:fence", "group:wood", "group:tree"}, groups = {fence=1, choppy=1, snappy=1, oddly_breakable_by_hand=1 }, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, } local sclip_tex = { @@ -182,7 +201,7 @@ local sclip_def = { paramtype = "light", paramtype2 = "wallmounted", is_ground_content = false, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, groups = { choppy=1, cracky=1 }, backface_culling = false } @@ -214,21 +233,36 @@ end minetest.register_node(":technic:insulator_clip", iclip_def) minetest.register_node(":technic:insulator_clip_fencepost", iclipfence_def) +-- MineClone2 support +local stone_ingrediant = nil +local white_dye_ingrediant = nil +local fence_ingrediant = nil + +if minetest.get_modpath("mcl_core") then + stone_ingrediant = "mcl_core:stone" + white_dye_ingrediant = "mcl_dye:white" + fence_ingrediant = "group:fence" +else + stone_ingrediant = "default:stone" + white_dye_ingrediant = "dye:white" + fence_ingrediant = "default:fence_wood" +end + minetest.register_craft({ output = "technic:insulator_clip", recipe = { - { "", "dye:white", ""}, + { "", white_dye_ingrediant, ""}, { "", "technic:raw_latex", ""}, - { "technic:raw_latex", "default:stone", "technic:raw_latex"}, + { "technic:raw_latex", stone_ingrediant, "technic:raw_latex"}, } }) minetest.register_craft({ output = "technic:insulator_clip_fencepost 2", recipe = { - { "", "dye:white", ""}, + { "", white_dye_ingrediant, ""}, { "", "technic:raw_latex", ""}, - { "technic:raw_latex", "default:fence_wood", "technic:raw_latex"}, + { "technic:raw_latex", wood_fence_ingrediant, "technic:raw_latex"}, } }) diff --git a/extranodes/mod.conf b/extranodes/mod.conf index 6f02b1c..5080158 100644 --- a/extranodes/mod.conf +++ b/extranodes/mod.conf @@ -1,3 +1,4 @@ name = extranodes -depends = default, technic_worldgen, basic_materials, concrete -optional_depends = unifieddyes, intllib, moreblocks, steel, streetsmod +depends = technic_worldgen, basic_materials, concrete +optional_depends = unifieddyes, intllib, moreblocks, steel, streetsmod, default, mcl_core, mcl_sounds +supported_games = minetest_game,mineclone2 \ No newline at end of file diff --git a/technic/crafts.lua b/technic/crafts.lua index 978bae8..f02d670 100644 --- a/technic/crafts.lua +++ b/technic/crafts.lua @@ -38,9 +38,9 @@ if pipeworks.enable_teleport_tube then minetest.register_craft({ output = 'pipeworks:teleport_tube_1', recipe = { - {'default:mese_crystal', 'technic:copper_coil', 'default:mese_crystal'}, + {mese_crystal_ingrediant, 'technic:copper_coil', mese_crystal_ingrediant}, {'pipeworks:tube_1', 'technic:control_logic_unit', 'pipeworks:tube_1'}, - {'default:mese_crystal', 'technic:copper_coil', 'default:mese_crystal'}, + {mese_crystal_ingrediant, 'technic:copper_coil', mese_crystal_ingrediant}, } }) end @@ -62,36 +62,36 @@ minetest.register_craft( { minetest.register_craft({ output = 'technic:diamond_drill_head', recipe = { - {'technic:stainless_steel_ingot', 'default:diamond', 'technic:stainless_steel_ingot'}, - {'default:diamond', '', 'default:diamond'}, - {'technic:stainless_steel_ingot', 'default:diamond', 'technic:stainless_steel_ingot'}, + {'technic:stainless_steel_ingot', diamond_ingrediant, 'technic:stainless_steel_ingot'}, + {diamond_ingrediant, '', diamond_ingrediant}, + {'technic:stainless_steel_ingot', diamond_ingrediant, 'technic:stainless_steel_ingot'}, } }) minetest.register_craft({ output = 'technic:green_energy_crystal', recipe = { - {'default:gold_ingot', 'technic:battery', 'dye:green'}, + {gold_ingot_ingrediant, 'technic:battery', green_dye_ingrediant}, {'technic:battery', 'technic:red_energy_crystal', 'technic:battery'}, - {'dye:green', 'technic:battery', 'default:gold_ingot'}, + {green_dye_ingrediant, 'technic:battery', gold_ingot_ingrediant}, } }) minetest.register_craft({ output = 'technic:blue_energy_crystal', recipe = { - {'moreores:mithril_ingot', 'technic:battery', 'dye:blue'}, + {'moreores:mithril_ingot', 'technic:battery', blue_dye_ingrediant}, {'technic:battery', 'technic:green_energy_crystal', 'technic:battery'}, - {'dye:blue', 'technic:battery', 'moreores:mithril_ingot'}, + {blue_dye_ingrediant, 'technic:battery', 'moreores:mithril_ingot'}, } }) minetest.register_craft({ output = 'technic:red_energy_crystal', recipe = { - {'moreores:silver_ingot', 'technic:battery', 'dye:red'}, + {'moreores:silver_ingot', 'technic:battery', red_dye_ingrediant}, {'technic:battery', 'basic_materials:energy_crystal_simple', 'technic:battery'}, - {'dye:red', 'technic:battery', 'moreores:silver_ingot'}, + {red_dye_ingrediant, 'technic:battery', 'moreores:silver_ingot'}, } }) @@ -143,7 +143,7 @@ minetest.register_craft({ output = 'technic:control_logic_unit', recipe = { {'', 'basic_materials:gold_wire', ''}, - {'default:copper_ingot', 'technic:silicon_wafer', 'default:copper_ingot'}, + {copper_ingrediant, 'technic:silicon_wafer', copper_ingrediant}, {'', 'technic:chromium_ingot', ''}, }, replacements = { {"basic_materials:gold_wire", "basic_materials:empty_spool"}, }, @@ -153,8 +153,8 @@ minetest.register_craft({ output = 'technic:mixed_metal_ingot 9', recipe = { {'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'}, - {'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'}, - {'default:tin_ingot', 'default:tin_ingot', 'default:tin_ingot'}, + {bronze_ingrediant, bronze_ingrediant, bronze_ingrediant}, + {tin_ingrediant, tin_ingrediant, tin_ingrediant}, } }) @@ -175,7 +175,7 @@ minetest.register_craft({ }) minetest.register_craft({ - output = "default:dirt 2", + output = dirt_ingrediant.." 2", type = "shapeless", replacements = {{"bucket:bucket_water","bucket:bucket_empty"}}, recipe = { @@ -191,14 +191,14 @@ minetest.register_craft({ type = "shapeless", recipe = { "technic:raw_latex", - "default:coal_lump", - "default:coal_lump", - "default:coal_lump", - "default:coal_lump", - "default:coal_lump", - "default:coal_lump", - "default:coal_lump", - "default:coal_lump", + coal_ingrediant, + coal_ingrediant, + coal_ingrediant, + coal_ingrediant, + coal_ingrediant, + coal_ingrediant, + coal_ingrediant, + coal_ingrediant, }, }) diff --git a/technic/init.lua b/technic/init.lua index 7669faf..11ddab8 100644 --- a/technic/init.lua +++ b/technic/init.lua @@ -1,11 +1,280 @@ -- namespace: technic -- (c) 2012-2013 by RealBadAngel +-- Mineclone2 Support +stone_sounds = nil +if minetest.get_modpath("mcl_sounds") then + stone_sounds = mcl_sounds.node_sound_stone_defaults() +else + stone_sounds = default.node_sound_stone_defaults() +end + +mt_light_max = nil +if minetest.get_modpath("mcl_core") then + mt_light_max = mcl_core.LIGHT_MAX +else + mt_light_max = default.LIGHT_MAX +end + +copper_ingrediant = nil +if minetest.get_modpath("mcl_core") then + copper_ingrediant = "mcl_copper:copper_ingot" +else + copper_ingrediant = 'default:copper_ingot' +end + +iron_ingrediant = nil +if minetest.get_modpath("mcl_core") then + iron_ingrediant = "mcl_core:iron_ingot" +else + iron_ingrediant = 'default:steel_ingot' +end + +mese_crystal_ingrediant = nil +if minetest.get_modpath("mcl_core") then + mese_crystal_ingrediant = "mesecons:wire_00000000_off" +else + mese_crystal_ingrediant = 'default:mese_crystal' +end + +diamond_ingrediant = nil +if minetest.get_modpath("mcl_core") then + diamond_ingrediant = "mcl_core:diamond" +else + diamond_ingrediant = 'default:diamond' +end + +glass_ingrediant = nil +if minetest.get_modpath("mcl_core") then + glass_ingrediant = "mcl_core:glass" +else + glass_ingrediant = 'default:glass' +end + +brick_block_ingrediant = nil +if minetest.get_modpath("mcl_core") then + brick_block_ingrediant = "mcl_core:brick_block" +else + brick_block_ingrediant = 'default:brick' +end + +mese_block_ingrediant = nil +if minetest.get_modpath("mcl_core") then + mese_block_ingrediant = "mesecons_torch:redstoneblock" +else + mese_block_ingrediant = "default:mese" +end + + +paper_ingrediant = nil +if minetest.get_modpath("mcl_core") then + paper_ingrediant = "mcl_core:paper" +else + paper_ingrediant = 'default:paper' +end + + +obsidian_glass_ingrediant = nil +if minetest.get_modpath("mcl_core") then + obsidian_glass_ingrediant = "mcl_core:obsidian" +else + obsidian_glass_ingrediant = 'default:obsidian_glass' +end + +obsidian_ingrediant = nil +if minetest.get_modpath("mcl_core") then + obsidian_ingrediant = "mcl_core:obsidian" +else + obsidian_ingrediant = 'default:obsidian' +end + +green_dye_ingrediant = nil +if minetest.get_modpath("mcl_core") then + green_dye_ingrediant = "mcl_dye:green" +else + green_dye_ingrediant = 'dye:green' +end + +blue_dye_ingrediant = nil +if minetest.get_modpath("mcl_core") then + blue_dye_ingrediant = "mcl_dye:blue" +else + blue_dye_ingrediant = 'dye:blue' +end + +red_dye_ingrediant = nil +if minetest.get_modpath("mcl_core") then + red_dye_ingrediant = "mcl_dye:red" +else + red_dye_ingrediant = 'dye:red' +end + +white_dye_ingrediant = nil +if minetest.get_modpath("mcl_core") then + white_dye_ingrediant = "mcl_dye:white" +else + white_dye_ingrediant = 'dye:white' +end + +gold_ingot_ingrediant = nil +if minetest.get_modpath("mcl_core") then + gold_ingot_ingrediant = "mcl_core:gold_ingot" +else + gold_ingot_ingrediant = 'default:gold_ingot' +end + +chest_ingrediant = nil +if minetest.get_modpath("mcl_core") then + chest_ingrediant = "mcl_chests:chest" +else + chest_ingrediant = "default:chest" +end + +stone_ingrediant = nil +if minetest.get_modpath("mcl_core") then + stone_ingrediant = "mcl_core:stone" +else + stone_ingrediant = "default:stone" +end + +wood_fence_ingrediant = nil +if minetest.get_modpath("mcl_core") then + wood_fence_ingrediant = "group:fence_wood" +else + wood_fence_ingrediant = "default:fence_wood" +end + + +diamond_ingrediant = nil +if minetest.get_modpath("mcl_core") then + diamond_ingrediant = "mcl_core:diamond" +else + diamond_ingrediant = "default:diamond" +end + +bronze_ingrediant = nil +if minetest.get_modpath("mcl_core") then + bronze_ingrediant = "mcl_copper:copper_ingot" +else + bronze_ingrediant = 'default:bronze_ingot' +end + +tin_ingrediant = nil +if minetest.get_modpath("mcl_core") then + tin_ingrediant = "moreores:tin_ingot" +else + tin_ingrediant = 'default:tin_ingot' +end + +sandstone_ingrediant = nil +if minetest.get_modpath("mcl_core") then + sandstone_ingrediant = "mcl_core:sandstone" +else + sandstone_ingrediant = 'default:desert_stone' +end + +sand_ingrediant = nil +if minetest.get_modpath("mcl_core") then + sand_ingrediant = "mcl_core:sand" +else + sand_ingrediant = 'default:sand' +end + +desert_stone_ingrediant = nil +if minetest.get_modpath("mcl_core") then + desert_stone_ingrediant = "mcl_core:redsandstone" +else + desert_stone_ingrediant = 'default:desert_stone' +end + +desert_sand_ingrediant = nil +if minetest.get_modpath("mcl_core") then + desert_sand_ingrediant = "mcl_core:redsand" +else + desert_sand_ingrediant = 'default:desert_sand' +end + + + +furnace_ingrediant = nil +if minetest.get_modpath("mcl_core") then + furnace_ingrediant = "mcl_furnaces:furnace" +else + furnace_ingrediant = 'default:furnace' +end + +mossy_cobble_ingrediant = nil +if minetest.get_modpath("mcl_core") then + mossy_cobble_ingrediant = "mcl_core:mossycobble" +else + mossy_cobble_ingrediant = 'default:mossycobble' +end + +snow_block_ingrediant = nil +if minetest.get_modpath("mcl_core") then + snow_block_ingrediant = "mcl_core:snowblock" +else + snow_block_ingrediant = 'default:snowblock' +end + +ice_block_ingrediant = nil +if minetest.get_modpath("mcl_core") then + ice_block_ingrediant = "mcl_core:ice" +else + ice_block_ingrediant = 'default:ice' +end + +granite_ingrediant = nil +if minetest.get_modpath("mcl_core") then + granite_ingrediant = "mcl_core:granite" +else + granite_ingrediant = 'technic:granite' +end + +granite_bricks_ingrediant = nil +if minetest.get_modpath("mcl_core") then + granite_bricks_ingrediant = "mcl_core:granite_smooth" +else + granite_bricks_ingrediant = 'technic:granite_bricks' +end + +coal_ingrediant = nil +if minetest.get_modpath("mcl_core") then + coal_ingrediant = "group:coal" +else + coal_ingrediant = "default:coal_lump" +end + +dirt_ingrediant = nil +if minetest.get_modpath("mcl_core") then + dirt_ingrediant = "mcl_core:dirt" +else + dirt_ingrediant = "default:dirt" +end + +mesecons_fiber_ingrediant = nil + +if minetest.get_modpath("mcl_core") then + mesecons_fiber_ingrediant = "mesecons:wire_00000000_off" +else + mesecons_fiber_ingrediant = "mesecons_materials:fiber" +end + +stick_ingrediant = nil + +if minetest.get_modpath("mcl_core") then + stick_ingrediant = "mcl_core:stick" +else + stick_ingrediant = "default:stick" +end + if not minetest.get_translator then error("[technic] Your Minetest version is no longer supported." .. " (version < 5.0.0)") end + + local load_start = os.clock() technic = rawget(_G, "technic") or {} diff --git a/technic/items.lua b/technic/items.lua index d1565d7..9da6466 100644 --- a/technic/items.lua +++ b/technic/items.lua @@ -131,7 +131,7 @@ minetest.register_node("technic:machine_casing", { paramtype = "light", drawtype = "allfaces", tiles = {"technic_machine_casing.png"}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, }) minetest.register_craftitem("technic:rubber_goo", { @@ -188,7 +188,7 @@ for p = 0, 35 do is_ground_content = true, groups = {uranium_block=1, not_in_creative_inventory=nici, cracky=1, level=2, radioactive=radioactivity}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, }); if not ov then minetest.register_craft({ diff --git a/technic/machines/HV/forcefield.lua b/technic/machines/HV/forcefield.lua index 5b8ff4f..ea28fcd 100644 --- a/technic/machines/HV/forcefield.lua +++ b/technic/machines/HV/forcefield.lua @@ -17,9 +17,9 @@ local cable_entry = "^technic_cable_connection_overlay.png" minetest.register_craft({ output = "technic:forcefield_emitter_off", recipe = { - {"default:mese", "basic_materials:motor", "default:mese" }, + {mese_block_ingrediant, "basic_materials:motor", mese_block_ingrediant }, {"technic:deployer_off", "technic:machine_casing", "technic:deployer_off"}, - {"default:mese", "technic:hv_cable", "default:mese" }, + {mese_block_ingrediant, "technic:hv_cable", mese_block_ingrediant }, } }) @@ -354,7 +354,7 @@ minetest.register_node("technic:forcefield", { drawtype = "glasslike", groups = {not_in_creative_inventory=1}, paramtype = "light", - light_source = default.LIGHT_MAX, + light_source = mt_light_max, diggable = false, drop = '', tiles = {{ diff --git a/technic/machines/HV/nuclear_reactor.lua b/technic/machines/HV/nuclear_reactor.lua index abaeb74..3978d3e 100644 --- a/technic/machines/HV/nuclear_reactor.lua +++ b/technic/machines/HV/nuclear_reactor.lua @@ -24,7 +24,7 @@ local cable_entry = "^technic_cable_connection_overlay.png" minetest.register_craft({ output = 'technic:hv_nuclear_reactor_core', recipe = { - {'technic:carbon_plate', 'default:obsidian_glass', 'technic:carbon_plate'}, + {'technic:carbon_plate', obsidian_glass_ingrediant, 'technic:carbon_plate'}, {'technic:composite_plate', 'technic:machine_casing', 'technic:composite_plate'}, {'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'}, } @@ -414,7 +414,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core", { mesh = "technic_reactor.obj", groups = {cracky = 1, technic_machine = 1, technic_hv = 1, digiline_remote_receive = 1}, legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, paramtype = "light", paramtype2 = "facedir", stack_max = 1, @@ -449,7 +449,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core_active", { groups = {cracky = 1, technic_machine = 1, technic_hv = 1, radioactive = 4, not_in_creative_inventory = 1, digiline_remote_receive = 1}, legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, drop = "technic:hv_nuclear_reactor_core", light_source = 14, paramtype = "light", diff --git a/technic/machines/HV/quarry.lua b/technic/machines/HV/quarry.lua index 98a0537..7129030 100644 --- a/technic/machines/HV/quarry.lua +++ b/technic/machines/HV/quarry.lua @@ -229,6 +229,13 @@ local function send_move_error(player) return 0 end +local quarry_pick = nill +if minetest.get_modpath("mcl_core") then + quarry_pick = "default_tool_diamondpick.png" +else + quarry_pick = "default_tool_mesepick.png" +end + minetest.register_node("technic:quarry", { description = S("%s Quarry"):format("HV"), tiles = { @@ -236,7 +243,7 @@ minetest.register_node("technic:quarry", { "technic_carbon_steel_block.png"..cable_entry, "technic_carbon_steel_block.png"..cable_entry, "technic_carbon_steel_block.png"..cable_entry, - "technic_carbon_steel_block.png^default_tool_mesepick.png", + "technic_carbon_steel_block.png^"..quarry_pick, "technic_carbon_steel_block.png"..cable_entry }, paramtype2 = "facedir", diff --git a/technic/machines/LV/alloy_furnace.lua b/technic/machines/LV/alloy_furnace.lua index 5e4f7c4..773d41c 100644 --- a/technic/machines/LV/alloy_furnace.lua +++ b/technic/machines/LV/alloy_furnace.lua @@ -4,9 +4,9 @@ minetest.register_craft({ output = 'technic:lv_alloy_furnace', recipe = { - {'default:brick', 'default:brick', 'default:brick'}, - {'default:brick', 'technic:machine_casing', 'default:brick'}, - {'default:brick', 'technic:lv_cable', 'default:brick'}, + {brick_block_ingrediant, brick_block_ingrediant, brick_block_ingrediant}, + {brick_block_ingrediant, 'technic:machine_casing', brick_block_ingrediant}, + {brick_block_ingrediant, 'technic:lv_cable', brick_block_ingrediant}, } }) diff --git a/technic/machines/LV/cables.lua b/technic/machines/LV/cables.lua index 69c0a24..b9c4584 100644 --- a/technic/machines/LV/cables.lua +++ b/technic/machines/LV/cables.lua @@ -4,9 +4,9 @@ minetest.register_alias("lv_cable", "technic:lv_cable") minetest.register_craft({ output = 'technic:lv_cable 6', recipe = { - {'default:paper', 'default:paper', 'default:paper'}, - {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'}, - {'default:paper', 'default:paper', 'default:paper'}, + {paper_ingrediant, paper_ingrediant, paper_ingrediant}, + {copper_ingrediant, copper_ingrediant, copper_ingrediant}, + {paper_ingrediant, paper_ingrediant, paper_ingrediant}, } }) diff --git a/technic/machines/LV/compressor.lua b/technic/machines/LV/compressor.lua index 84eb4c5..be26365 100644 --- a/technic/machines/LV/compressor.lua +++ b/technic/machines/LV/compressor.lua @@ -4,7 +4,7 @@ minetest.register_alias("compressor", "technic:lv_compressor") minetest.register_craft({ output = 'technic:lv_compressor', recipe = { - {'default:stone', 'basic_materials:motor', 'default:stone'}, + {stone_ingrediant, 'basic_materials:motor', stone_ingrediant}, {'mesecons:piston', 'technic:machine_casing', 'mesecons:piston'}, {'basic_materials:silver_wire', 'technic:lv_cable', 'basic_materials:silver_wire'}, }, diff --git a/technic/machines/LV/generator.lua b/technic/machines/LV/generator.lua index dc9815f..20fcaac 100644 --- a/technic/machines/LV/generator.lua +++ b/technic/machines/LV/generator.lua @@ -8,9 +8,9 @@ minetest.register_alias("lv_generator", "technic:lv_generator") minetest.register_craft({ output = 'technic:lv_generator', recipe = { - {'default:stone', 'default:furnace', 'default:stone'}, - {'default:stone', 'technic:machine_casing', 'default:stone'}, - {'default:stone', 'technic:lv_cable', 'default:stone'}, + {stone_ingrediant, furnace_ingrediant, stone_ingrediant}, + {stone_ingrediant, 'technic:machine_casing', stone_ingrediant}, + {stone_ingrediant, 'technic:lv_cable', stone_ingrediant}, } }) diff --git a/technic/machines/LV/geothermal.lua b/technic/machines/LV/geothermal.lua index abe6951..616cc9e 100644 --- a/technic/machines/LV/geothermal.lua +++ b/technic/machines/LV/geothermal.lua @@ -10,9 +10,9 @@ local S = technic.getter minetest.register_craft({ output = 'technic:geothermal', recipe = { - {'technic:granite', 'default:diamond', 'technic:granite'}, + {granite_ingrediant, diamond_ingrediant, granite_ingrediant}, {'basic_materials:copper_wire', 'technic:machine_casing', 'basic_materials:copper_wire'}, - {'technic:granite', 'technic:lv_cable', 'technic:granite'}, + {granite_ingrediant, 'technic:lv_cable', granite_ingrediant}, }, replacements = { {"basic_materials:copper_wire", "basic_materials:empty_spool"}, @@ -90,7 +90,7 @@ minetest.register_node("technic:geothermal", { technic_machine=1, technic_lv=1}, paramtype2 = "facedir", legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Geothermal %s Generator"):format("LV")) @@ -107,7 +107,7 @@ minetest.register_node("technic:geothermal_active", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1}, legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, drop = "technic:geothermal", technic_run = run, }) diff --git a/technic/machines/LV/grinder.lua b/technic/machines/LV/grinder.lua index 9e45bf4..9fd21fc 100644 --- a/technic/machines/LV/grinder.lua +++ b/technic/machines/LV/grinder.lua @@ -3,9 +3,9 @@ minetest.register_alias("grinder", "technic:lv_grinder") minetest.register_craft({ output = 'technic:lv_grinder', recipe = { - {'default:desert_stone', 'default:diamond', 'default:desert_stone'}, - {'default:desert_stone', 'technic:machine_casing', 'default:desert_stone'}, - {'technic:granite', 'technic:lv_cable', 'technic:granite'}, + {desert_stone_ingrediant, diamond_ingrediant, desert_stone_ingrediant}, + {desert_stone_ingrediant, 'technic:machine_casing', desert_stone_ingrediant}, + {granite_ingrediant, 'technic:lv_cable', granite_ingrediant}, } }) diff --git a/technic/machines/LV/lamp.lua b/technic/machines/LV/lamp.lua index a4605f2..72683d1 100644 --- a/technic/machines/LV/lamp.lua +++ b/technic/machines/LV/lamp.lua @@ -149,7 +149,7 @@ technic.register_machine("LV", "technic:lv_lamp_active", technic.receiver) minetest.register_craft({ output = "technic:lv_lamp", recipe = { - {"default:glass", "default:glass", "default:glass"}, + {glass_ingrediant, glass_ingrediant, glass_ingrediant}, {"technic:lv_led", "technic:lv_led", "technic:lv_led"}, {"mesecons_materials:glue", "technic:lv_cable", "mesecons_materials:glue"}, } diff --git a/technic/machines/LV/music_player.lua b/technic/machines/LV/music_player.lua index 3bbb441..f47d6b8 100644 --- a/technic/machines/LV/music_player.lua +++ b/technic/machines/LV/music_player.lua @@ -7,9 +7,9 @@ minetest.register_alias("music_player", "technic:music_player") minetest.register_craft({ output = 'technic:music_player', recipe = { - {'technic:chromium_ingot', 'default:diamond', 'technic:chromium_ingot'}, - {'default:diamond', 'technic:machine_casing', 'default:diamond'}, - {'default:mossycobble', 'technic:lv_cable', 'default:mossycobble'}, + {'technic:chromium_ingot', diamond_ingrediant, 'technic:chromium_ingot'}, + {diamond_ingrediant, 'technic:machine_casing', diamond_ingrediant}, + {mossy_cobble_ingrediant, 'technic:lv_cable', mossy_cobble_ingrediant}, } }) @@ -96,7 +96,7 @@ minetest.register_node("technic:music_player", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1}, connect_sides = {"bottom"}, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("%s Music Player"):format("LV")) diff --git a/technic/machines/LV/solar_panel.lua b/technic/machines/LV/solar_panel.lua index b3daedc..4e5763b 100644 --- a/technic/machines/LV/solar_panel.lua +++ b/technic/machines/LV/solar_panel.lua @@ -50,7 +50,7 @@ minetest.register_node("technic:solar_panel", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1}, connect_sides = {"bottom"}, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, description = S("Small Solar %s Generator"):format("LV"), active = false, drawtype = "nodebox", diff --git a/technic/machines/LV/water_mill.lua b/technic/machines/LV/water_mill.lua index e26224e..a397737 100644 --- a/technic/machines/LV/water_mill.lua +++ b/technic/machines/LV/water_mill.lua @@ -11,7 +11,7 @@ minetest.register_alias("water_mill", "technic:water_mill") minetest.register_craft({ output = 'technic:water_mill', recipe = { - {'technic:marble', 'default:diamond', 'technic:marble'}, + {'technic:marble', diamond_ingrediant, 'technic:marble'}, {'group:wood', 'technic:machine_casing', 'group:wood'}, {'technic:marble', 'technic:lv_cable', 'technic:marble'}, } @@ -80,7 +80,7 @@ minetest.register_node("technic:water_mill", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1}, legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Hydro %s Generator"):format("LV")) @@ -98,7 +98,7 @@ minetest.register_node("technic:water_mill_active", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1}, legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, drop = "technic:water_mill", technic_run = run, technic_disabled_machine_name = "technic:water_mill", diff --git a/technic/machines/MV/hydro_turbine.lua b/technic/machines/MV/hydro_turbine.lua index 0d4904c..b1a8704 100644 --- a/technic/machines/MV/hydro_turbine.lua +++ b/technic/machines/MV/hydro_turbine.lua @@ -77,7 +77,7 @@ minetest.register_node("technic:hydro_turbine", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_mv=1}, legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Hydro %s Generator"):format("MV")) @@ -95,7 +95,7 @@ minetest.register_node("technic:hydro_turbine_active", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_mv=1, not_in_creative_inventory=1}, legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, drop = "technic:hydro_turbine", technic_run = run, technic_disabled_machine_name = "technic:hydro_turbine", diff --git a/technic/machines/MV/lighting.lua b/technic/machines/MV/lighting.lua index f7c9124..9f30f5b 100644 --- a/technic/machines/MV/lighting.lua +++ b/technic/machines/MV/lighting.lua @@ -105,7 +105,7 @@ minetest.register_node('technic:homedecor_glowlight_half_yellow', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -145,7 +145,7 @@ minetest.register_node('technic:homedecor_glowlight_half_yellow_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_half_yellow", @@ -186,7 +186,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_yellow', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -226,7 +226,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_yellow_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX-1, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_quarter_yellow", @@ -268,7 +268,7 @@ minetest.register_node('technic:homedecor_glowlight_half_white', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -308,7 +308,7 @@ minetest.register_node('technic:homedecor_glowlight_half_white_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_half_white", @@ -349,7 +349,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_white', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -389,7 +389,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_white_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX-1, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_quarter_white", @@ -430,7 +430,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_yellow', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -470,7 +470,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_yellow_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX-1, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_small_cube_yellow", @@ -511,7 +511,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_white', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -551,7 +551,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_white_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX-1, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_small_cube_white", diff --git a/technic/machines/MV/power_radiator.lua b/technic/machines/MV/power_radiator.lua index 329f055..f3a0701 100644 --- a/technic/machines/MV/power_radiator.lua +++ b/technic/machines/MV/power_radiator.lua @@ -123,7 +123,7 @@ minetest.register_node("technic:power_radiator", { tiles = {"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png"}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2}, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, drawtype = "nodebox", paramtype = "light", is_ground_content = true, diff --git a/technic/machines/MV/tool_workshop.lua b/technic/machines/MV/tool_workshop.lua index 678a1fd..eee566f 100644 --- a/technic/machines/MV/tool_workshop.lua +++ b/technic/machines/MV/tool_workshop.lua @@ -10,9 +10,9 @@ local tube_entry = "^pipeworks_tube_connection_wooden.png" minetest.register_craft({ output = 'technic:tool_workshop', recipe = { - {'group:wood', 'default:diamond', 'group:wood'}, + {'group:wood', diamond_ingrediant, 'group:wood'}, {'mesecons_pistons:piston_sticky_off', 'technic:machine_casing', 'technic:carbon_cloth'}, - {'default:obsidian', 'technic:mv_cable', 'default:obsidian'}, + {obsidian_ingrediant, 'technic:mv_cable', obsidian_ingrediant}, } }) @@ -95,7 +95,7 @@ minetest.register_node("technic:tool_workshop", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_mv=1, tubedevice=1, tubedevice_receiver=1}, connect_sides = {"bottom", "back", "left", "right"}, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("%s Tool Workshop"):format("MV")) diff --git a/technic/machines/MV/wind_mill.lua b/technic/machines/MV/wind_mill.lua index 1baf54c..c05b744 100644 --- a/technic/machines/MV/wind_mill.lua +++ b/technic/machines/MV/wind_mill.lua @@ -25,7 +25,7 @@ minetest.register_node("technic:wind_mill_frame", { tiles = {"technic_carbon_steel_block.png", "default_glass.png"}, sunlight_propagates = true, groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, paramtype = "light", }) @@ -72,7 +72,7 @@ minetest.register_node("technic:wind_mill", { paramtype2 = "facedir", groups = {cracky=1, technic_machine=1, technic_mv=1}, connect_sides = {"top", "bottom", "back", "left", "right"}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, drawtype = "nodebox", paramtype = "light", node_box = { diff --git a/technic/machines/other/anchor.lua b/technic/machines/other/anchor.lua index 44aeffa..a2d2f2c 100644 --- a/technic/machines/other/anchor.lua +++ b/technic/machines/other/anchor.lua @@ -73,7 +73,7 @@ minetest.register_node("technic:admin_anchor", { tiles = {"technic_admin_anchor.png"}, is_ground_content = true, groups = {cracky=3, not_in_creative_inventory=1}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, after_place_node = function (pos, placer) local meta = minetest.get_meta(pos) if placer and placer:is_player() then diff --git a/technic/machines/other/coal_alloy_furnace.lua b/technic/machines/other/coal_alloy_furnace.lua index c2de151..0197b67 100644 --- a/technic/machines/other/coal_alloy_furnace.lua +++ b/technic/machines/other/coal_alloy_furnace.lua @@ -6,9 +6,9 @@ local S = technic.getter minetest.register_craft({ output = 'technic:coal_alloy_furnace', recipe = { - {'default:brick', 'default:brick', 'default:brick'}, - {'default:brick', '', 'default:brick'}, - {'default:brick', 'default:brick', 'default:brick'}, + {brick_block_ingrediant, brick_block_ingrediant, brick_block_ingrediant}, + {brick_block_ingrediant, '', brick_block_ingrediant}, + {brick_block_ingrediant, brick_block_ingrediant, brick_block_ingrediant}, } }) @@ -36,7 +36,7 @@ minetest.register_node("technic:coal_alloy_furnace", { paramtype2 = "facedir", groups = {cracky=2}, legacy_facedir_simple = true, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("formspec", formspec) @@ -62,7 +62,7 @@ minetest.register_node("technic:coal_alloy_furnace_active", { drop = "technic:coal_alloy_furnace", groups = {cracky=2, not_in_creative_inventory=1}, legacy_facedir_simple = true, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, can_dig = technic.machine_can_dig, allow_metadata_inventory_put = technic.machine_inventory_put, allow_metadata_inventory_take = technic.machine_inventory_take, diff --git a/technic/machines/other/coal_furnace.lua b/technic/machines/other/coal_furnace.lua index 53a0f8b..02c9094 100644 --- a/technic/machines/other/coal_furnace.lua +++ b/technic/machines/other/coal_furnace.lua @@ -1,5 +1,10 @@ local S = technic.getter +if minetest.get_modpath("mcl_core") then + minetest.registered_nodes["mcl_furnaces:furnace"].description = S("Fuel-Fired Furnace") + minetest.override_item("mcl_furnaces:furnace", { description = S("Fuel-Fired Furnace") }) +else if minetest.registered_nodes["default:furnace"].description == "Furnace" then minetest.override_item("default:furnace", { description = S("Fuel-Fired Furnace") }) end +end diff --git a/technic/machines/other/constructor.lua b/technic/machines/other/constructor.lua index 9117224..714354d 100644 --- a/technic/machines/other/constructor.lua +++ b/technic/machines/other/constructor.lua @@ -142,7 +142,7 @@ local function make_constructor(mark, length) groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, mesecon = 2, technic_constructor = 1}, mesecons = {effector = {action_on = make_on(mark, length)}}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) local formspec = "size[8,9;]".. @@ -194,7 +194,7 @@ local function make_constructor(mark, length) groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, mesecon=2, not_in_creative_inventory=1, technic_constructor=1}, mesecons= {effector = {action_off = make_off(mark)}}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, allow_metadata_inventory_put = allow_inventory_put, allow_metadata_inventory_take = technic.machine_inventory_take, allow_metadata_inventory_move = technic.machine_inventory_move, diff --git a/technic/machines/other/frames.lua b/technic/machines/other/frames.lua index c116187..8120f4c 100644 --- a/technic/machines/other/frames.lua +++ b/technic/machines/other/frames.lua @@ -981,7 +981,7 @@ minetest.register_craft({ output = 'technic:template 10', recipe = { { '', 'basic_materials:brass_ingot', '' }, - { 'basic_materials:brass_ingot', 'default:mese_crystal', 'basic_materials:brass_ingot' }, + { 'basic_materials:brass_ingot', mese_crystal_ingrediant, 'basic_materials:brass_ingot' }, { '', 'basic_materials:brass_ingot', '' }, } }) @@ -1009,7 +1009,7 @@ minetest.register_craft({ output = 'technic:template_tool', recipe = { { '', 'technic:template', '' }, - { 'default:mese_crystal', 'default:stick', 'default:mese_crystal' }, + { mese_crystal_ingrediant, 'default:stick', mese_crystal_ingrediant }, { '', 'default:stick', '' }, } }) diff --git a/technic/machines/other/injector.lua b/technic/machines/other/injector.lua index 6bd5a83..307a38d 100644 --- a/technic/machines/other/injector.lua +++ b/technic/machines/other/injector.lua @@ -47,7 +47,7 @@ minetest.register_craft({ output = 'technic:injector 1', recipe = { {'', 'technic:control_logic_unit',''}, - {'', 'default:chest',''}, + {'', chest_ingrediant,''}, {'', 'pipeworks:tube_1',''}, } }) @@ -105,7 +105,7 @@ minetest.register_node("technic:injector", { end, connect_sides = {left=1, right=1, back=1, top=1, bottom=1}, }, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Self-Contained Injector")) diff --git a/technic/machines/power_monitor.lua b/technic/machines/power_monitor.lua index 7e8b850..80e8ce2 100644 --- a/technic/machines/power_monitor.lua +++ b/technic/machines/power_monitor.lua @@ -10,7 +10,7 @@ minetest.register_craft({ output = "technic:power_monitor", recipe = { {"", "", ""}, - {"", "technic:machine_casing", "default:copper_ingot"}, + {"", "technic:machine_casing", copper_ingrediant}, {"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"} } }) @@ -28,7 +28,7 @@ minetest.register_node("technic:power_monitor",{ paramtype2 = "facedir", groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1, technic_machine=1}, connect_sides = {"bottom", "back"}, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Power Monitor")) diff --git a/technic/machines/register/alloy_recipes.lua b/technic/machines/register/alloy_recipes.lua index 388e0bb..eeee442 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}, - {"default:copper_ingot 7", "default:tin_ingot", "default:bronze_ingot 8", 12}, + {"copper_ingrediant 7", "default:tin_ingot", "default:bronze_ingot 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,7 +21,7 @@ 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"}, - {"default:copper_ingot 2", "technic:zinc_ingot", "basic_materials:brass_ingot 3"}, + {"copper_ingrediant 2", "technic:zinc_ingot", "basic_materials:brass_ingot 3"}, {"default:sand 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 diff --git a/technic/machines/register/battery_box.lua b/technic/machines/register/battery_box.lua index 190ddbf..c96df6a 100644 --- a/technic/machines/register/battery_box.lua +++ b/technic/machines/register/battery_box.lua @@ -17,9 +17,9 @@ technic.register_power_tool("technic:blue_energy_crystal", 450000) minetest.register_craft({ output = "technic:battery", recipe = { - {"group:wood", "default:copper_ingot", "group:wood"}, + {"group:wood", copper_ingrediant, "group:wood"}, {"group:wood", "default:tin_ingot", "group:wood"}, - {"group:wood", "default:copper_ingot", "group:wood"}, + {"group:wood", copper_ingrediant, "group:wood"}, } }) -- Sulfur-lead-water recipes: @@ -300,7 +300,7 @@ function technic.register_battery_box(data) connect_sides = {"bottom"}, tube = data.tube and tube or nil, paramtype2 = "facedir", - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, drop = "technic:"..ltier.."_battery_box0", on_construct = function(pos) local meta = minetest.get_meta(pos) diff --git a/technic/machines/register/cables.lua b/technic/machines/register/cables.lua index 70da6d6..e132819 100644 --- a/technic/machines/register/cables.lua +++ b/technic/machines/register/cables.lua @@ -161,7 +161,7 @@ function technic.register_cable(tier, size) inventory_image = "technic_"..ltier.."_cable_wield.png", wield_image = "technic_"..ltier.."_cable_wield.png", groups = groups, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, drop = "technic:"..ltier.."_cable", paramtype = "light", sunlight_propagates = true, @@ -201,7 +201,7 @@ function technic.register_cable(tier, size) description = S("%s Cable Plate"):format(tier), tiles = {"technic_"..ltier.."_cable.png"}, groups = table.copy(groups), - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, drop = "technic:"..ltier.."_cable_plate_1", paramtype = "light", sunlight_propagates = true, diff --git a/technic/machines/register/common.lua b/technic/machines/register/common.lua index 0e7658b..7dcb7c9 100644 --- a/technic/machines/register/common.lua +++ b/technic/machines/register/common.lua @@ -35,7 +35,7 @@ end -- handles the machine upgrades when set or removed local function on_machine_upgrade(meta, stack) local stack_name = stack:get_name() - if stack_name == "default:chest" then + if stack_name == chest_ingrediant then meta:set_int("public", 1) return 1 elseif stack_name ~= "technic:control_logic_unit" @@ -47,7 +47,7 @@ end -- something is about to be removed local function on_machine_downgrade(meta, stack, list) - if stack:get_name() == "default:chest" then + if stack:get_name() == chest_ingrediant then local inv = meta:get_inventory() local upg1, upg2 = inv:get_stack("upgrade1", 1), inv:get_stack("upgrade2", 1) diff --git a/technic/machines/register/compressor_recipes.lua b/technic/machines/register/compressor_recipes.lua index acb9eca..264abe2 100644 --- a/technic/machines/register/compressor_recipes.lua +++ b/technic/machines/register/compressor_recipes.lua @@ -9,18 +9,19 @@ function technic.register_compressor_recipe(data) end local recipes = { - {"default:snowblock", "default:ice"}, - {"default:sand 2", "default:sandstone"}, - {"default:desert_sand 2", "default:desert_sandstone"}, - {"default:silver_sand 2", "default:silver_sandstone"}, - {"default:desert_sand", "default:desert_stone"}, + {snow_block_ingrediant, ice_block_ingrediant}, + {sand_ingrediant.." 2", sandstone_ingrediant}, + {desert_sand_ingrediant.." 2", desert_stone_ingrediant}, + {desert_sand_ingrediant, desert_stone_ingrediant}, {"technic:mixed_metal_ingot", "technic:composite_plate"}, - {"default:copper_ingot 5", "technic:copper_plate"}, + {copper_ingrediant.." 5", "technic:copper_plate"}, {"technic:coal_dust 4", "technic:graphite"}, {"technic:carbon_cloth", "technic:carbon_plate"}, {"technic:uranium35_ingot 5", "technic:uranium_fuel"}, } - +if minetest.get_modpath("default") then +table.insert(recipes, {"default:silver_sand 2", "default:silver_sandstone"}) +end -- defuse the default sandstone recipe, since we have the compressor to take over in a more realistic manner minetest.clear_craft({ recipe = { diff --git a/technic/machines/register/generator.lua b/technic/machines/register/generator.lua index 9120e29..8644c3e 100644 --- a/technic/machines/register/generator.lua +++ b/technic/machines/register/generator.lua @@ -125,7 +125,7 @@ function technic.register_generator(data) groups = groups, connect_sides = {"bottom", "back", "left", "right"}, legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, tube = data.tube and tube or nil, on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -192,7 +192,7 @@ function technic.register_generator(data) groups = active_groups, connect_sides = {"bottom"}, legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, tube = data.tube and tube or nil, drop = "technic:"..ltier.."_generator", can_dig = technic.machine_can_dig, diff --git a/technic/machines/register/grinder_recipes.lua b/technic/machines/register/grinder_recipes.lua index 5adb4f0..0a13a29 100644 --- a/technic/machines/register/grinder_recipes.lua +++ b/technic/machines/register/grinder_recipes.lua @@ -104,9 +104,9 @@ 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("Copper", copper_ingrediant) register_dust("Lead", "technic:lead_ingot") -register_dust("Gold", "default:gold_ingot") +register_dust("Gold", gold_ingot_ingrediant) register_dust("Mithril", "moreores:mithril_ingot") register_dust("Silver", "moreores:silver_ingot") register_dust("Stainless Steel", "technic:stainless_steel_ingot") diff --git a/technic/machines/register/machine_base.lua b/technic/machines/register/machine_base.lua index 8e1dee7..01d588c 100644 --- a/technic/machines/register/machine_base.lua +++ b/technic/machines/register/machine_base.lua @@ -174,7 +174,7 @@ function technic.register_base_machine(data) tube = data.tube and tube or nil, connect_sides = data.connect_sides or connect_default, legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, on_construct = function(pos) local node = minetest.get_node(pos) local meta = minetest.get_meta(pos) @@ -245,7 +245,7 @@ function technic.register_base_machine(data) groups = active_groups, connect_sides = data.connect_sides or connect_default, legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, tube = data.tube and tube or nil, can_dig = technic.machine_can_dig, allow_metadata_inventory_put = technic.machine_inventory_put, diff --git a/technic/machines/register/solar_array.lua b/technic/machines/register/solar_array.lua index 443ac90..601ffc2 100644 --- a/technic/machines/register/solar_array.lua +++ b/technic/machines/register/solar_array.lua @@ -45,7 +45,7 @@ function technic.register_solar_array(data) "technic_"..ltier.."_solar_array_side.png", "technic_"..ltier.."_solar_array_side.png"}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, ["technic_"..ltier]=1}, connect_sides = {"bottom"}, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, description = S("Arrayed Solar %s Generator"):format(tier), active = false, drawtype = "nodebox", diff --git a/technic/machines/supply_converter.lua b/technic/machines/supply_converter.lua index 2ecd610..99bc570 100644 --- a/technic/machines/supply_converter.lua +++ b/technic/machines/supply_converter.lua @@ -200,7 +200,7 @@ minetest.register_node("technic:supply_converter", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_all_tiers=1}, connect_sides = {"top", "bottom"}, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, on_receive_fields = supply_converter_receive_fields, on_construct = function(pos) local meta = minetest.get_meta(pos) diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua index 521e2f8..e9964a3 100644 --- a/technic/machines/switching_station.lua +++ b/technic/machines/switching_station.lua @@ -15,7 +15,7 @@ minetest.register_craft({ output = "technic:switching_station", recipe = { {"", "technic:lv_transformer", ""}, - {"default:copper_ingot", "technic:machine_casing", "default:copper_ingot"}, + {copper_ingrediant, "technic:machine_casing", copper_ingrediant}, {"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"} } }) @@ -38,7 +38,7 @@ minetest.register_node("technic:switching_station",{ "technic_water_mill_top_active.png"}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1}, connect_sides = {"bottom"}, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Switching Station")) diff --git a/technic/mod.conf b/technic/mod.conf index 7b8d08c..9fe34cc 100644 --- a/technic/mod.conf +++ b/technic/mod.conf @@ -1,3 +1,4 @@ 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 +depends = pipeworks, technic_worldgen, basic_materials +optional_depends = bucket, default, screwdriver, mesecons,mesecons_torch, mesecons_mvps, digilines, digiline_remote, intllib, unified_inventory, vector_extras, dye, craftguide,i3 +supported_games = minetest_game,mineclone2 \ No newline at end of file diff --git a/technic/radiation.lua b/technic/radiation.lua index 7092b69..52554b2 100644 --- a/technic/radiation.lua +++ b/technic/radiation.lua @@ -52,7 +52,7 @@ local rad_resistance_node = { ["default:ice"] = 5.6, ["default:lava_flowing"] = 8.5, ["default:lava_source"] = 17, - ["default:mese"] = 21, + [mese_block_ingrediant] = 21, ["default:mossycobble"] = 15, ["default:tinblock"] = 37, ["pbj_pup:pbj_pup"] = 10000, @@ -64,7 +64,7 @@ local rad_resistance_node = { ["nyancat:nyancat"] = 10000, ["nyancat:nyancat_rainbow"] = 10000, ["default:obsidian"] = 18, - ["default:obsidian_glass"] = 18, + [obsidian_glass_ingrediant] = 18, ["default:sand"] = 10, ["default:sandstone"] = 15, ["default:sandstonebrick"] = 15, @@ -153,7 +153,7 @@ local rad_resistance_node = { ["technic:chromium_block"] = 37, ["technic:corium_flowing"] = 40, ["technic:corium_source"] = 80, - ["technic:granite"] = 18, + [granite_ingrediant] = 18, ["technic:lead_block"] = 80, ["technic:marble"] = 18, ["technic:marble_bricks"] = 18, @@ -457,7 +457,7 @@ minetest.register_node("technic:chernobylite_block", { tiles = {"technic_chernobylite_block.png"}, is_ground_content = true, groups = {cracky=1, radioactive=4, level=2}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, light_source = 2, }) diff --git a/technic/tools/cans.lua b/technic/tools/cans.lua index 6507f7a..8853560 100644 --- a/technic/tools/cans.lua +++ b/technic/tools/cans.lua @@ -135,7 +135,7 @@ minetest.register_craft({ output = 'technic:river_water_can 1', recipe = { {'technic:zinc_ingot', 'technic:rubber', 'technic:zinc_ingot'}, - {'default:steel_ingot', '', 'default:steel_ingot'}, - {'technic:zinc_ingot', 'default:steel_ingot', 'technic:zinc_ingot'}, + {iron_ingrediant, '', iron_ingrediant}, + {'technic:zinc_ingot', iron_ingrediant, 'technic:zinc_ingot'}, } }) diff --git a/technic/tools/chainsaw.lua b/technic/tools/chainsaw.lua index d2ee966..2d6244d 100644 --- a/technic/tools/chainsaw.lua +++ b/technic/tools/chainsaw.lua @@ -340,7 +340,13 @@ minetest.register_tool("technic:chainsaw", { }) local mesecons_button = minetest.get_modpath("mesecons_button") -local trigger = mesecons_button and "mesecons_button:button_off" or "default:mese_crystal_fragment" +local trigger = nil + +if minetest.get_modpath("mcl_core") then + trigger = "mesecons_button:button_stone_off" +else + trigger = mesecons_button and "mesecons_button:button_off" or "default:mese_crystal_fragment" +end minetest.register_craft({ output = "technic:chainsaw", diff --git a/technic/tools/mining_drill.lua b/technic/tools/mining_drill.lua index dfef394..4b1ad3f 100644 --- a/technic/tools/mining_drill.lua +++ b/technic/tools/mining_drill.lua @@ -6,9 +6,9 @@ local S = technic.getter minetest.register_craft({ output = 'technic:mining_drill', recipe = { - {'default:tin_ingot', 'technic:diamond_drill_head', 'default:tin_ingot'}, + {tin_ingrediant, 'technic:diamond_drill_head', tin_ingrediant}, {'technic:stainless_steel_ingot', 'basic_materials:motor', 'technic:stainless_steel_ingot'}, - {'', 'technic:red_energy_crystal', 'default:copper_ingot'}, + {'', 'technic:red_energy_crystal', copper_ingrediant}, } }) minetest.register_craft({ diff --git a/technic/tools/mining_lasers.lua b/technic/tools/mining_lasers.lua index e4dd178..0f5d88b 100644 --- a/technic/tools/mining_lasers.lua +++ b/technic/tools/mining_lasers.lua @@ -11,25 +11,25 @@ local S = technic.getter minetest.register_craft({ output = "technic:laser_mk1", recipe = { - {"default:diamond", "basic_materials:brass_ingot", "default:obsidian_glass"}, + {diamond_ingrediant, "basic_materials:brass_ingot", obsidian_glass_ingrediant}, {"", "basic_materials:brass_ingot", "technic:red_energy_crystal"}, - {"", "", "default:copper_ingot"}, + {"", "", copper_ingrediant}, } }) minetest.register_craft({ output = "technic:laser_mk2", recipe = { - {"default:diamond", "technic:carbon_steel_ingot", "technic:laser_mk1"}, + {diamond_ingrediant, "technic:carbon_steel_ingot", "technic:laser_mk1"}, {"", "technic:carbon_steel_ingot", "technic:green_energy_crystal"}, - {"", "", "default:copper_ingot"}, + {"", "", copper_ingrediant}, } }) minetest.register_craft({ output = "technic:laser_mk3", recipe = { - {"default:diamond", "technic:carbon_steel_ingot", "technic:laser_mk2"}, + {diamond_ingrediant, "technic:carbon_steel_ingot", "technic:laser_mk2"}, {"", "technic:carbon_steel_ingot", "technic:blue_energy_crystal"}, - {"", "", "default:copper_ingot"}, + {"", "", copper_ingrediant}, } }) diff --git a/technic/tools/sonic_screwdriver.lua b/technic/tools/sonic_screwdriver.lua index 536f47c..0cbe511 100644 --- a/technic/tools/sonic_screwdriver.lua +++ b/technic/tools/sonic_screwdriver.lua @@ -90,9 +90,9 @@ minetest.register_tool("technic:sonic_screwdriver", { minetest.register_craft({ output = "technic:sonic_screwdriver", recipe = { - {"", "default:diamond", ""}, - {"mesecons_materials:fiber", "technic:battery", "mesecons_materials:fiber"}, - {"mesecons_materials:fiber", "moreores:mithril_ingot", "mesecons_materials:fiber"} + {"", diamond_ingrediant, ""}, + {mesecons_fiber_ingrediant, "technic:battery", mesecons_fiber_ingrediant}, + {mesecons_fiber_ingrediant, "moreores:mithril_ingot", mesecons_fiber_ingrediant} } }) diff --git a/technic/tools/tree_tap.lua b/technic/tools/tree_tap.lua index ae68b56..7a37423 100644 --- a/technic/tools/tree_tap.lua +++ b/technic/tools/tree_tap.lua @@ -38,8 +38,8 @@ minetest.register_tool("technic:treetap", { minetest.register_craft({ output = "technic:treetap", recipe = { - {"pipeworks:tube_1", "group:wood", "default:stick"}, - {"", "default:stick", "default:stick"} + {"pipeworks:tube_1", "group:wood", stick_ingrediant}, + {"", stick_ingrediant, stick_ingrediant} }, }) diff --git a/technic_chests/copper_chest.lua b/technic_chests/copper_chest.lua index c989bac..47241b7 100644 --- a/technic_chests/copper_chest.lua +++ b/technic_chests/copper_chest.lua @@ -1,18 +1,18 @@ minetest.register_craft({ output = 'technic:copper_chest 1', recipe = { - {'default:copper_ingot','default:copper_ingot','default:copper_ingot'}, - {'default:copper_ingot','technic:iron_chest','default:copper_ingot'}, - {'default:copper_ingot','default:copper_ingot','default:copper_ingot'}, + {copper_ingrediant,copper_ingrediant,copper_ingrediant}, + {copper_ingrediant,'technic:iron_chest',copper_ingrediant}, + {copper_ingrediant,copper_ingrediant,copper_ingrediant}, } }) minetest.register_craft({ output = 'technic:copper_locked_chest 1', recipe = { - {'default:copper_ingot','default:copper_ingot','default:copper_ingot'}, - {'default:copper_ingot','technic:iron_locked_chest','default:copper_ingot'}, - {'default:copper_ingot','default:copper_ingot','default:copper_ingot'}, + {copper_ingrediant,copper_ingrediant,copper_ingrediant}, + {copper_ingrediant,'technic:iron_locked_chest',copper_ingrediant}, + {copper_ingrediant,copper_ingrediant,copper_ingrediant}, } }) diff --git a/technic_chests/gold_chest.lua b/technic_chests/gold_chest.lua index 24cbb5c..419cc96 100644 --- a/technic_chests/gold_chest.lua +++ b/technic_chests/gold_chest.lua @@ -11,18 +11,18 @@ for _, material in ipairs(material_list) do minetest.register_craft({ output = 'technic:gold_chest', recipe = { - {'default:gold_ingot','default:gold_ingot','default:gold_ingot'}, - {'default:gold_ingot',"technic:"..material.."_chest",'default:gold_ingot'}, - {'default:gold_ingot','default:gold_ingot','default:gold_ingot'}, + {gold_ingot_ingrediant,gold_ingot_ingrediant,gold_ingot_ingrediant}, + {gold_ingot_ingrediant,"technic:"..material.."_chest",gold_ingot_ingrediant}, + {gold_ingot_ingrediant,gold_ingot_ingrediant,gold_ingot_ingrediant}, } }) minetest.register_craft({ output = 'technic:gold_locked_chest', recipe = { - {'default:gold_ingot','default:gold_ingot','default:gold_ingot'}, - {'default:gold_ingot',"technic:"..material.."_locked_chest",'default:gold_ingot'}, - {'default:gold_ingot','default:gold_ingot','default:gold_ingot'}, + {gold_ingot_ingrediant,gold_ingot_ingrediant,gold_ingot_ingrediant}, + {gold_ingot_ingrediant,"technic:"..material.."_locked_chest",gold_ingot_ingrediant}, + {gold_ingot_ingrediant,gold_ingot_ingrediant,gold_ingot_ingrediant}, } }) end diff --git a/technic_chests/init.lua b/technic_chests/init.lua index 188e516..5a01628 100644 --- a/technic_chests/init.lua +++ b/technic_chests/init.lua @@ -4,6 +4,65 @@ local modpath = minetest.get_modpath("technic_chests") +-- Mineclone2 Support +stone_sounds = nil +if minetest.get_modpath("mcl_sounds") then + stone_sounds = mcl_sounds.node_sound_stone_defaults() +else + stone_sounds = default.node_sound_stone_defaults() +end + +node_sounds = nil +if minetest.get_modpath("mcl_sounds") then + node_sounds = mcl_sounds.node_sound_defaults() +else + node_sounds = default.node_sound_defaults() +end + +wood_sounds = nil +if minetest.get_modpath("mcl_sounds") then + wood_sounds = mcl_sounds.node_sound_wood_defaults() +else + wood_sounds = default.node_sound_wood_defaults() +end + +-- Mineclone2 Recipes +chest_ingrediant = nil +if minetest.get_modpath("mcl_core") then + chest_ingrediant = "mcl_chests:chest" +else + chest_ingrediant = "default:chest" +end + +copper_ingrediant = nil +if minetest.get_modpath("mcl_core") then + copper_ingrediant = "mcl_copper:copper_ingot" +else + copper_ingrediant = 'default:copper_ingot' +end + +gold_ingot_ingrediant = nil +if minetest.get_modpath("mcl_core") then + gold_ingot_ingrediant = "mcl_core:gold_ingot" +else + gold_ingot_ingrediant = 'default:gold_ingot' +end + +granite_ingrediant = nil +if minetest.get_modpath("mcl_core") then + granite_ingrediant = "mcl_core:granite" +else + granite_ingrediant = 'technic:granite' +end + +granite_bricks_ingrediant = nil +if minetest.get_modpath("mcl_core") then + granite_bricks_ingrediant = "mcl_core:granite_smooth" +else + granite_bricks_ingrediant = 'technic:granite_bricks' +end + + technic = rawget(_G, "technic") or {} technic.chests = {} diff --git a/technic_chests/iron_chest.lua b/technic_chests/iron_chest.lua index a1945bc..49717a3 100644 --- a/technic_chests/iron_chest.lua +++ b/technic_chests/iron_chest.lua @@ -9,11 +9,12 @@ minetest.register_craft({ output = 'technic:iron_chest 1', recipe = { {cast_iron_ingot,cast_iron_ingot,cast_iron_ingot}, - {cast_iron_ingot,'default:chest',cast_iron_ingot}, + {cast_iron_ingot,chest_ingrediant,cast_iron_ingot}, {cast_iron_ingot,cast_iron_ingot,cast_iron_ingot}, } }) +if minetest.get_modpath("default") then minetest.register_craft({ output = 'technic:iron_locked_chest 1', recipe = { @@ -22,6 +23,7 @@ minetest.register_craft({ {cast_iron_ingot,cast_iron_ingot,cast_iron_ingot}, } }) +end minetest.register_craft({ output = 'technic:iron_locked_chest 1', diff --git a/technic_chests/mod.conf b/technic_chests/mod.conf index 99048c3..0556e50 100644 --- a/technic_chests/mod.conf +++ b/technic_chests/mod.conf @@ -1,3 +1,4 @@ name = technic_chests -depends = default, basic_materials -optional_depends = moreblocks, moreores, pipeworks, intllib, tubelib +depends = basic_materials +optional_depends = moreblocks, moreores, pipeworks, intllib, tubelib, default, mcl_core +supported_games = minetest_game,mineclone2 \ No newline at end of file diff --git a/technic_chests/register.lua b/technic_chests/register.lua index 2cde3b0..1ac8406 100644 --- a/technic_chests/register.lua +++ b/technic_chests/register.lua @@ -298,7 +298,7 @@ function technic.chests:definition(name, data) groups = self.groups, tube = self.tube, legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, after_place_node = locked_after_place, after_dig_node = pipeworks.after_dig, diff --git a/technic_cnc/cnc.lua b/technic_cnc/cnc.lua index 2f28264..fed1b3c 100644 --- a/technic_cnc/cnc.lua +++ b/technic_cnc/cnc.lua @@ -19,7 +19,7 @@ if technic_cnc.use_technic then minetest.register_craft({ output = 'technic:cnc', recipe = { - {'default:glass', 'technic:diamond_drill_head', 'default:glass'}, + {glass_ingrediant, 'technic:diamond_drill_head', glass_ingrediant}, {'technic:control_logic_unit', 'technic:machine_casing', 'basic_materials:motor'}, {'technic:carbon_steel_ingot', 'technic:lv_cable', 'technic:carbon_steel_ingot'}, }, @@ -34,9 +34,9 @@ else minetest.register_craft({ output = 'technic:cnc', recipe = { - {'default:glass', 'default:diamond', 'default:glass'}, + {glass_ingrediant, diamond_ingrediant, glass_ingrediant}, {'basic_materials:ic', 'default:steelblock', 'basic_materials:motor'}, - {'default:steel_ingot', 'default:mese', 'default:steel_ingot'}, + {'default:steel_ingot', mese_block_ingrediant, 'default:steel_ingot'}, }, }) diff --git a/technic_cnc/cnc_materials.lua b/technic_cnc/cnc_materials.lua index e63c792..2243ea2 100644 --- a/technic_cnc/cnc_materials.lua +++ b/technic_cnc/cnc_materials.lua @@ -1,131 +1,130 @@ --- REGISTER MATERIALS AND PROPERTIES FOR NONCUBIC ELEMENTS: ------------------------------------------------------------ - local S = technic_cnc.getter +-- Conditional variables for MineClone2 compatibility +local is_mcl = minetest.get_modpath("mcl_core") + +-- Textures and names for MineClone2 +local dirt_texture = is_mcl and "default_dirt.png" or "default_dirt.png" +local grass_texture = is_mcl and "default_grass.png" or "default_grass.png" +local wood_texture = is_mcl and "default_wood.png" or "default_wood.png" +local stone_texture = is_mcl and "default_stone.png" or "default_stone.png" +local cobble_texture = is_mcl and "default_cobble.png" or "default_cobble.png" +local brick_texture = is_mcl and "default_brick.png" or "default_brick.png" +local sandstone_texture = is_mcl and "default_sandstone.png" or "default_sandstone.png" +local leaves_texture = is_mcl and "default_leaves.png" or "default_leaves.png" +local tree_texture = is_mcl and "default_tree.png" or "default_tree.png" +local bronzeblock_texture = is_mcl and "mcl_core_bronze_block.png" or "default_bronze_block.png" + -- DIRT -------- -technic_cnc.register_all("default:dirt", - {snappy=2,choppy=2,oddly_breakable_by_hand=3,not_in_creative_inventory=1}, - {"default_dirt.png"}, - S("Dirt")) +technic_cnc.register_all(is_mcl and "mcl_core:dirt" or "default:dirt", + {snappy=2,choppy=2,oddly_breakable_by_hand=3,not_in_creative_inventory=1}, + {dirt_texture}, + S("Dirt")) + -- (DIRT WITH) GRASS --------------------- -technic_cnc.register_all("default:dirt_with_grass", - {snappy=2,choppy=2,oddly_breakable_by_hand=3,not_in_creative_inventory=1}, - {"default_grass.png"}, - S("Grassy dirt")) +technic_cnc.register_all(is_mcl and "mcl_core:dirt_with_grass" or "default:dirt_with_grass", + {snappy=2,choppy=2,oddly_breakable_by_hand=3,not_in_creative_inventory=1}, + {grass_texture}, + S("Grassy dirt")) + -- WOOD -------- -technic_cnc.register_all("default:wood", - {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, - {"default_wood.png"}, - S("Wooden")) +technic_cnc.register_all(is_mcl and "mcl_core:wood" or "default:wood", + {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + {wood_texture}, + S("Wooden")) + -- STONE --------- -technic_cnc.register_all("default:stone", - {cracky=3, not_in_creative_inventory=1}, - {"default_stone.png"}, - S("Stone")) +technic_cnc.register_all(is_mcl and "mcl_core:stone" or "default:stone", + {cracky=3, not_in_creative_inventory=1}, + {stone_texture}, + S("Stone")) + -- COBBLE ---------- -technic_cnc.register_all("default:cobble", - {cracky=3, not_in_creative_inventory=1}, - {"default_cobble.png"}, - S("Cobble")) +technic_cnc.register_all(is_mcl and "mcl_core:cobble" or "default:cobble", + {cracky=3, not_in_creative_inventory=1}, + {cobble_texture}, + S("Cobble")) + -- BRICK --------- -technic_cnc.register_all("default:brick", - {cracky=3, not_in_creative_inventory=1}, - {"default_brick.png"}, - S("Brick")) +technic_cnc.register_all(is_mcl and "mcl_core:brick" or "default:brick", + {cracky=3, not_in_creative_inventory=1}, + {brick_texture}, + S("Brick")) -- SANDSTONE ------------- -technic_cnc.register_all("default:sandstone", - {crumbly=2, cracky=3, not_in_creative_inventory=1}, - {"default_sandstone.png"}, - S("Sandstone")) +technic_cnc.register_all(is_mcl and "mcl_core:sandstone" or "default:sandstone", + {crumbly=2, cracky=3, not_in_creative_inventory=1}, + {sandstone_texture}, + S("Sandstone")) -- LEAVES ---------- -technic_cnc.register_all("default:leaves", - {snappy=2, choppy=2, oddly_breakable_by_hand=3, not_in_creative_inventory=1}, - {"default_leaves.png"}, - S("Leaves")) +technic_cnc.register_all(is_mcl and "mcl_core:leaves" or "default:leaves", + {snappy=2, choppy=2, oddly_breakable_by_hand=3, not_in_creative_inventory=1}, + {leaves_texture}, + S("Leaves")) + -- TREE -------- -technic_cnc.register_all("default:tree", - {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, wood=1, not_in_creative_inventory=1}, - {"default_tree.png"}, - S("Tree")) +technic_cnc.register_all(is_mcl and "mcl_core:tree" or "default:tree", + {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, wood=1, not_in_creative_inventory=1}, + {tree_texture}, + S("Tree")) -- Bronze --------- -technic_cnc.register_all("default:bronzeblock", - {cracky=1, level=2, not_in_creative_inventory=1}, - {"default_bronze_block.png"}, - S("Bronze")) +if not is_mcl then + technic_cnc.register_all("default:bronzeblock", + {cracky=1, level=2, not_in_creative_inventory=1}, + {bronzeblock_texture}, + S("Bronze")) +end - -local steeltex = "default_steel_block.png" -local steelname = "Steel" +local steeltex = is_mcl and "default_steel_block.png" or "default_steel_block.png" +local steelname = is_mcl and "Iron" or "Steel" if technic_cnc.technic_modpath then - steeltex = "technic_wrought_iron_block.png" - steelname = "Wrought Iron" + if not is_mcl then + steeltex = "technic_wrought_iron_block.png" + steelname = "Wrought Iron" - -- Stainless Steel - -------- - technic_cnc.register_all("technic:stainless_steel_block", - {cracky=1, level=2, not_in_creative_inventory=1}, - {"technic_stainless_steel_block.png"}, - S("Stainless Steel")) + -- Stainless Steel + technic_cnc.register_all("technic:stainless_steel_block", + {cracky=1, level=2, not_in_creative_inventory=1}, + {"technic_stainless_steel_block.png"}, + S("Stainless Steel")) - -- Marble - ------------ - technic_cnc.register_all("technic:marble", - {cracky=3, not_in_creative_inventory=1}, - {"technic_marble.png"}, - S("Marble")) + -- Marble + technic_cnc.register_all("technic:marble", + {cracky=3, not_in_creative_inventory=1}, + {"technic_marble.png"}, + S("Marble")) - -- Granite - ------------ - technic_cnc.register_all("technic:granite", - {cracky=1, not_in_creative_inventory=1}, - {"technic_granite.png"}, - S("Granite")) - - -- Blast-resistant concrete - --------------------------- - - technic_cnc.register_all("technic:blast_resistant_concrete", - {cracky=2, level=2, not_in_creative_inventory=1}, - {"technic_blast_resistant_concrete_block.png"}, - S("Blast-resistant concrete")) + -- Blast-resistant concrete + technic_cnc.register_all("technic:blast_resistant_concrete", + {cracky=2, level=2, not_in_creative_inventory=1}, + {"technic_blast_resistant_concrete_block.png"}, + S("Blast-resistant concrete")) + end end -- STEEL ---------------- -technic_cnc.register_all("default:steelblock", - {cracky=1, level=2, not_in_creative_inventory=1}, - {steeltex}, - S(steelname)) +technic_cnc.register_all(is_mcl and "mcl_core:iron_block" or "default:steelblock", + {cracky=1, level=2, not_in_creative_inventory=1}, + {steeltex}, + S(steelname)) -- CONCRETE AND CEMENT ----------------------- +if minetest.get_modpath("basic_materials") then + technic_cnc.register_all("basic_materials:concrete_block", + {cracky=2, level=2, not_in_creative_inventory=1}, + {"basic_materials_concrete_block.png"}, + S("Concrete")) -technic_cnc.register_all("basic_materials:concrete_block", - {cracky=2, level=2, not_in_creative_inventory=1}, - {"basic_materials_concrete_block.png"}, - S("Concrete")) + technic_cnc.register_all("basic_materials:cement_block", + {cracky=2, level=2, not_in_creative_inventory=1}, + {"basic_materials_cement_block.png"}, + S("Cement")) -technic_cnc.register_all("basic_materials:cement_block", - {cracky=2, level=2, not_in_creative_inventory=1}, - {"basic_materials_cement_block.png"}, - S("Cement")) - -technic_cnc.register_all("basic_materials:brass_block", - {cracky=1, level=2, not_in_creative_inventory=1}, - {"basic_materials_brass_block.png"}, - S("Brass block")) + technic_cnc.register_all("basic_materials:brass_block", + {cracky=1, level=2, not_in_creative_inventory=1}, + {"basic_materials_brass_block.png"}, + S("Brass block")) +end diff --git a/technic_cnc/mod.conf b/technic_cnc/mod.conf index 4e0f940..300fdd8 100644 --- a/technic_cnc/mod.conf +++ b/technic_cnc/mod.conf @@ -1,3 +1,4 @@ name = technic_cnc -depends = default, basic_materials -optional_depends = technic +depends = basic_materials +optional_depends = technic, default, mcl_core +supported_games = minetest_game,mineclone2 \ No newline at end of file diff --git a/technic_worldgen/crafts.lua b/technic_worldgen/crafts.lua index 0590e70..31d3c0e 100644 --- a/technic_worldgen/crafts.lua +++ b/technic_worldgen/crafts.lua @@ -48,12 +48,21 @@ minetest.register_craftitem(":technic:sulfur_lump", { inventory_image = "technic_sulfur_lump.png", }) +if minetest.get_modpath("default") then minetest.register_alias("technic:wrought_iron_ingot", "default:steel_ingot") minetest.override_item("default:steel_ingot", { description = S("Wrought Iron Ingot"), inventory_image = "technic_wrought_iron_ingot.png", }) +elseif minetest.get_modpath("mcl_core") then + minetest.register_alias("technic:wrought_iron_ingot", "mcl_core:iron_ingot") + + minetest.override_item("mcl_core:iron_ingot", { + description = S("Wrought Iron Ingot"), + inventory_image = "technic_wrought_iron_ingot.png", + }) +end minetest.register_craftitem(":technic:cast_iron_ingot", { description = S("Cast Iron Ingot"), @@ -127,6 +136,9 @@ minetest.register_craft({ output = "technic:cast_iron_ingot", }) + + + minetest.register_craft({ type = 'cooking', recipe = "technic:cast_iron_ingot", diff --git a/technic_worldgen/init.lua b/technic_worldgen/init.lua index 2f36920..dbd5f0c 100644 --- a/technic_worldgen/init.lua +++ b/technic_worldgen/init.lua @@ -1,5 +1,34 @@ local modpath = minetest.get_modpath("technic_worldgen") +-- Mineclone Support +stone_sounds = nil +if minetest.get_modpath("mcl_sounds") then + stone_sounds = mcl_sounds.node_sound_stone_defaults() +else + stone_sounds = default.node_sound_stone_defaults() +end + +node_sounds = nil +if minetest.get_modpath("mcl_sounds") then + node_sounds = mcl_sounds.node_sound_defaults() +else + node_sounds = default.node_sound_defaults() +end + +wood_sounds = nil +if minetest.get_modpath("mcl_sounds") then + wood_sounds = mcl_sounds.node_sound_wood_defaults() +else + wood_sounds = default.node_sound_wood_defaults() +end + +leaves_sounds = nil +if minetest.get_modpath("mcl_sounds") then + leaves_sounds = mcl_sounds.node_sound_leaves_defaults() +else + leaves_sounds = default.node_sound_leaves_defaults() +end + technic = rawget(_G, "technic") or {} technic.worldgen = { gettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end, diff --git a/technic_worldgen/mod.conf b/technic_worldgen/mod.conf index 49988f5..4215a15 100644 --- a/technic_worldgen/mod.conf +++ b/technic_worldgen/mod.conf @@ -1,3 +1,4 @@ name = technic_worldgen -depends = default, basic_materials -optional_depends = intllib, mg, doors, farming, glooptest, mesecons_doors, vessels +depends = basic_materials +optional_depends = intllib, mg, doors, farming, glooptest, mesecons_doors, vessels, default, mcl_core, mcl_sounds +supported_games = minetest_game,mineclone2 diff --git a/technic_worldgen/nodes.lua b/technic_worldgen/nodes.lua index 90888e4..c5a55a1 100644 --- a/technic_worldgen/nodes.lua +++ b/technic_worldgen/nodes.lua @@ -6,7 +6,7 @@ minetest.register_node( ":technic:mineral_uranium", { tiles = { "default_stone.png^technic_mineral_uranium.png" }, is_ground_content = true, groups = {cracky=3, radioactive=1}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, drop = "technic:uranium_lump", }) @@ -15,7 +15,7 @@ minetest.register_node( ":technic:mineral_chromium", { tiles = { "default_stone.png^technic_mineral_chromium.png" }, is_ground_content = true, groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, drop = "technic:chromium_lump", }) @@ -24,7 +24,7 @@ minetest.register_node( ":technic:mineral_zinc", { tiles = { "default_stone.png^technic_mineral_zinc.png" }, is_ground_content = true, groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, drop = "technic:zinc_lump", }) @@ -33,7 +33,7 @@ minetest.register_node( ":technic:mineral_lead", { tiles = { "default_stone.png^technic_mineral_lead.png" }, is_ground_content = true, groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, drop = "technic:lead_lump", }) @@ -42,32 +42,35 @@ minetest.register_node( ":technic:mineral_sulfur", { tiles = { "default_stone.png^technic_mineral_sulfur.png" }, is_ground_content = true, groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, drop = "technic:sulfur_lump", }) +if minetest.get_modpath("default") then minetest.register_node( ":technic:granite", { description = S("Granite"), tiles = { "technic_granite.png" }, is_ground_content = true, groups = {cracky=1}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, }) + minetest.register_node( ":technic:granite_bricks", { description = S("Granite Bricks"), tiles = { "technic_granite_bricks.png" }, is_ground_content = false, groups = {cracky=1}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, }) +end minetest.register_node( ":technic:marble", { description = S("Marble"), tiles = { "technic_marble.png" }, is_ground_content = true, groups = {cracky=3, marble=1}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, }) minetest.register_node( ":technic:marble_bricks", { @@ -75,7 +78,7 @@ minetest.register_node( ":technic:marble_bricks", { tiles = { "technic_marble_bricks.png" }, is_ground_content = false, groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), + sounds = stone_sounds, }) minetest.register_node(":technic:uranium_block", { @@ -83,7 +86,7 @@ minetest.register_node(":technic:uranium_block", { tiles = { "technic_uranium_block.png" }, is_ground_content = true, groups = {uranium_block=1, cracky=1, level=2, radioactive=2}, - sounds = default.node_sound_stone_defaults() + sounds = stone_sounds }) minetest.register_node(":technic:chromium_block", { @@ -91,7 +94,7 @@ minetest.register_node(":technic:chromium_block", { tiles = { "technic_chromium_block.png" }, is_ground_content = true, groups = {cracky=1, level=2}, - sounds = default.node_sound_stone_defaults() + sounds = stone_sounds }) minetest.register_node(":technic:zinc_block", { @@ -99,7 +102,7 @@ minetest.register_node(":technic:zinc_block", { tiles = { "technic_zinc_block.png" }, is_ground_content = true, groups = {cracky=1, level=2}, - sounds = default.node_sound_stone_defaults() + sounds = stone_sounds }) minetest.register_node(":technic:lead_block", { @@ -107,22 +110,24 @@ minetest.register_node(":technic:lead_block", { tiles = { "technic_lead_block.png" }, is_ground_content = true, groups = {cracky=1, level=2}, - sounds = default.node_sound_stone_defaults() + sounds = stone_sounds }) +if minetest.get_modpath("default") then minetest.register_alias("technic:wrought_iron_block", "default:steelblock") minetest.override_item("default:steelblock", { description = S("Wrought Iron Block"), tiles = { "technic_wrought_iron_block.png" }, }) +end minetest.register_node(":technic:cast_iron_block", { description = S("Cast Iron Block"), tiles = { "technic_cast_iron_block.png" }, is_ground_content = true, groups = {cracky=1, level=2}, - sounds = default.node_sound_stone_defaults() + sounds = stone_sounds }) minetest.register_node(":technic:carbon_steel_block", { @@ -130,7 +135,7 @@ minetest.register_node(":technic:carbon_steel_block", { tiles = { "technic_carbon_steel_block.png" }, is_ground_content = true, groups = {cracky=1, level=2}, - sounds = default.node_sound_stone_defaults() + sounds = stone_sounds }) minetest.register_node(":technic:stainless_steel_block", { @@ -138,16 +143,18 @@ minetest.register_node(":technic:stainless_steel_block", { tiles = { "technic_stainless_steel_block.png" }, is_ground_content = true, groups = {cracky=1, level=2}, - sounds = default.node_sound_stone_defaults() + sounds = stone_sounds }) +if minetest.get_modpath("default") then minetest.register_craft({ output = 'technic:granite_bricks 4', recipe = { - {'technic:granite','technic:granite'}, - {'technic:granite','technic:granite'} + {granite_ingrediant,granite_ingrediant}, + {granite_ingrediant,granite_ingrediant} } }) +end minetest.register_craft({ output = 'technic:marble_bricks 4', @@ -172,6 +179,8 @@ local function for_each_registered_node(action) end end +if minetest.get_modpath("default") then + for_each_registered_node(function(node_name, node_def) if node_name ~= "default:steelblock" and node_name:find("steelblock", 1, true) and @@ -202,3 +211,4 @@ for_each_registered_node(function(node_name, node_def) end end) +end \ No newline at end of file diff --git a/technic_worldgen/oregen.lua b/technic_worldgen/oregen.lua index 4fd41fd..a7f55be 100644 --- a/technic_worldgen/oregen.lua +++ b/technic_worldgen/oregen.lua @@ -1,148 +1,101 @@ local uranium_params = { - offset = 0, - scale = 1, - spread = {x = 100, y = 100, z = 100}, - seed = 420, - octaves = 3, - persist = 0.7 + offset = 0, + scale = 1, + spread = {x = 100, y = 100, z = 100}, + seed = 420, + octaves = 3, + persist = 0.7 } local uranium_threshold = 0.55 local chromium_params = { - offset = 0, - scale = 1, - spread = {x = 100, y = 100, z = 100}, - seed = 421, - octaves = 3, - persist = 0.7 + offset = 0, + scale = 1, + spread = {x = 100, y = 100, z = 100}, + seed = 421, + octaves = 3, + persist = 0.7 } local chromium_threshold = 0.55 local zinc_params = { - offset = 0, - scale = 1, - spread = {x = 100, y = 100, z = 100}, - seed = 422, - octaves = 3, - persist = 0.7 + offset = 0, + scale = 1, + spread = {x = 100, y = 100, z = 100}, + seed = 422, + octaves = 3, + persist = 0.7 } local zinc_threshold = 0.5 local lead_params = { - offset = 0, - scale = 1, - spread = {x = 100, y = 100, z = 100}, - seed = 423, - octaves = 3, - persist = 0.7 + offset = 0, + scale = 1, + spread = {x = 100, y = 100, z = 100}, + seed = 423, + octaves = 3, + persist = 0.7 } local lead_threshold = 0.3 +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" + +-- Uranium minetest.register_ore({ - ore_type = "scatter", - ore = "technic:mineral_uranium", - wherein = "default:stone", - clust_scarcity = 8*8*8, - clust_num_ores = 4, - clust_size = 3, - y_min = -300, - y_max = -80, - noise_params = uranium_params, - noise_threshold = uranium_threshold, + ore_type = "scatter", + ore = "technic:mineral_uranium", + wherein = stone_id, + clust_scarcity = 8*8*8, + clust_num_ores = 4, + clust_size = 3, + y_min = -300, + y_max = -80, + noise_params = uranium_params, + noise_threshold = uranium_threshold, }) +-- Chromium minetest.register_ore({ - ore_type = "scatter", - ore = "technic:mineral_chromium", - wherein = "default:stone", - clust_scarcity = 8*8*8, - clust_num_ores = 2, - clust_size = 3, - y_min = -200, - y_max = -100, - noise_params = chromium_params, - noise_threshold = chromium_threshold, + ore_type = "scatter", + ore = "technic:mineral_chromium", + wherein = stone_id, + clust_scarcity = 8*8*8, + clust_num_ores = 2, + clust_size = 3, + y_min = -200, + y_max = -100, + noise_params = chromium_params, + noise_threshold = chromium_threshold, }) +-- Zinc minetest.register_ore({ - ore_type = "scatter", - ore = "technic:mineral_chromium", - wherein = "default:stone", - clust_scarcity = 6*6*6, - clust_num_ores = 2, - clust_size = 3, - y_min = -31000, - y_max = -200, - flags = "absheight", - noise_params = chromium_params, - noise_threshold = chromium_threshold, + ore_type = "scatter", + ore = "technic:mineral_zinc", + wherein = stone_id, + clust_scarcity = 8*8*8, + clust_num_ores = 5, + clust_size = 7, + y_min = -32, + y_max = 2, + noise_params = zinc_params, + noise_threshold = zinc_threshold, }) +-- Lead minetest.register_ore({ - ore_type = "scatter", - ore = "technic:mineral_zinc", - wherein = "default:stone", - clust_scarcity = 8*8*8, - clust_num_ores = 5, - clust_size = 7, - y_min = -32, - y_max = 2, - noise_params = zinc_params, - noise_threshold = zinc_threshold, -}) - -minetest.register_ore({ - ore_type = "scatter", - ore = "technic:mineral_zinc", - wherein = "default:stone", - clust_scarcity = 6*6*6, - clust_num_ores = 4, - clust_size = 3, - y_min = -31000, - y_max = -32, - flags = "absheight", - noise_params = zinc_params, - noise_threshold = zinc_threshold, -}) - -minetest.register_ore({ - ore_type = "scatter", - ore = "technic:mineral_lead", - wherein = "default:stone", - clust_scarcity = 9*9*9, - clust_num_ores = 5, - clust_size = 3, - y_min = -16, - y_max = 16, - noise_params = lead_params, - noise_threshold = lead_threshold, -}) - -minetest.register_ore({ - ore_type = "scatter", - ore = "technic:mineral_lead", - wherein = "default:stone", - clust_scarcity = 8*8*8, - clust_num_ores = 5, - clust_size = 3, - y_min = -128, - y_max = -16, - noise_params = lead_params, - noise_threshold = lead_threshold, -}) - -minetest.register_ore({ - ore_type = "scatter", - ore = "technic:mineral_lead", - wherein = "default:stone", - clust_scarcity = 6*6*6, - clust_num_ores = 5, - clust_size = 3, - y_min = -31000, - y_max = -128, - flags = "absheight", - noise_params = lead_params, - noise_threshold = lead_threshold, + ore_type = "scatter", + ore = "technic:mineral_lead", + wherein = stone_id, + clust_scarcity = 9*9*9, + clust_num_ores = 5, + clust_size = 3, + y_min = -16, + y_max = 16, + noise_params = lead_params, + noise_threshold = lead_threshold, }) -- Sulfur @@ -150,78 +103,79 @@ local sulfur_buf = {} local sulfur_noise minetest.register_on_generated(function(minp, maxp) - local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") - local a = VoxelArea:new({MinEdge=emin, MaxEdge=emax}) - local data = vm:get_data(sulfur_buf) - local pr = PseudoRandom(17 * minp.x + 42 * minp.y + 101 * minp.z) - sulfur_noise = sulfur_noise or minetest.get_perlin(9876, 3, 0.5, 100) + local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") + local a = VoxelArea:new({MinEdge=emin, MaxEdge=emax}) + local data = vm:get_data(sulfur_buf) + local pr = PseudoRandom(17 * minp.x + 42 * minp.y + 101 * minp.z) + sulfur_noise = sulfur_noise or minetest.get_perlin(9876, 3, 0.5, 100) - local c_lava = minetest.get_content_id("default:lava_source") - local c_lava_flowing = minetest.get_content_id("default:lava_flowing") - local c_stone = minetest.get_content_id("default:stone") - local c_sulfur = minetest.get_content_id("technic:mineral_sulfur") + local c_lava = minetest.get_content_id(lava_source_id) + local c_lava_flowing = minetest.get_content_id(lava_flowing_id) + local c_stone = minetest.get_content_id(stone_id) + local c_sulfur = minetest.get_content_id("technic:mineral_sulfur") - local grid_size = 5 - for x = minp.x + math.floor(grid_size / 2), maxp.x, grid_size do - for y = minp.y + math.floor(grid_size / 2), maxp.y, grid_size do - for z = minp.z + math.floor(grid_size / 2), maxp.z, grid_size do - local c = data[a:index(x, y, z)] - if (c == c_lava or c == c_lava_flowing) - and sulfur_noise:get3d({x = x, y = z, z = z}) >= 0.4 then - for i in a:iter( - math.max(minp.x, x - grid_size), - math.max(minp.y, y - grid_size), - math.max(minp.z, z - grid_size), - math.min(maxp.x, x + grid_size), - math.min(maxp.y, y + grid_size), - math.min(maxp.z, z + grid_size) - ) do - if data[i] == c_stone and pr:next(1, 10) <= 7 then - data[i] = c_sulfur - end - end - end - end - end - end + local grid_size = 5 + for x = minp.x + math.floor(grid_size / 2), maxp.x, grid_size do + for y = minp.y + math.floor(grid_size / 2), maxp.y, grid_size do + for z = minp.z + math.floor(grid_size / 2), maxp.z, grid_size do + local c = data[a:index(x, y, z)] + if (c == c_lava or c == c_lava_flowing) + and sulfur_noise:get3d({x = x, y = z, z = z}) >= 0.4 then + for i in a:iter( + math.max(minp.x, x - grid_size), + math.max(minp.y, y - grid_size), + math.max(minp.z, z - grid_size), + math.min(maxp.x, x + grid_size), + math.min(maxp.y, y + grid_size), + math.min(maxp.z, z + grid_size) + ) do + if data[i] == c_stone and pr:next(1, 10) <= 7 then + data[i] = c_sulfur + end + end + end + end + end + end - vm:set_data(data) - vm:write_to_map(data) + vm:set_data(data) + vm:write_to_map(data) end) - +-- Marble and Granite (if enabled) if technic.config:get_bool("enable_marble_generation") then - minetest.register_ore({ - ore_type = "sheet", - ore = "technic:marble", - wherein = "default:stone", - clust_scarcity = 1, - clust_num_ores = 1, - clust_size = 3, - y_min = -31000, - y_max = -50, - noise_threshold = 0.4, - noise_params = { - offset = 0, scale = 15, spread = {x = 150, y = 150, z = 150}, - seed = 23, octaves = 3, persist = 0.70 - } - }) + minetest.register_ore({ + ore_type = "sheet", + ore = "technic:marble", + wherein = stone_id, + clust_scarcity = 1, + clust_num_ores = 1, + clust_size = 3, + y_min = -31000, + y_max = -50, + noise_threshold = 0.4, + noise_params = { + offset = 0, scale = 15, spread = {x = 150, y = 150, z = 150}, + seed = 23, octaves = 3, persist = 0.70 + } + }) end - +if not minetest.get_modpath("mcl_core") then if technic.config:get_bool("enable_granite_generation") then - minetest.register_ore({ - ore_type = "sheet", - ore = "technic:granite", - wherein = "default:stone", - clust_scarcity = 1, - clust_num_ores = 1, - clust_size = 4, - y_min = -31000, - y_max = -150, - noise_threshold = 0.4, - noise_params = { - offset = 0, scale = 15, spread = {x = 130, y = 130, z = 130}, - seed = 24, octaves = 3, persist = 0.70 - } - }) + minetest.register_ore({ + ore_type = "sheet", + ore = "technic:granite", + wherein = stone_id, + clust_scarcity = 1, + clust_num_ores = 1, + clust_size = 4, + y_min = -31000, + y_max = -150, + noise_threshold = 0.4, + noise_params = { + offset = 0, scale = 15, spread = {x = 130, y = 130, z = 130}, + seed = 24, octaves = 3, persist = 0.70 + } + }) +end end diff --git a/technic_worldgen/rubber.lua b/technic_worldgen/rubber.lua index 11da9ca..aaea86a 100644 --- a/technic_worldgen/rubber.lua +++ b/technic_worldgen/rubber.lua @@ -11,7 +11,7 @@ minetest.register_node(":moretrees:rubber_tree_sapling", { paramtype = "light", walkable = false, groups = {dig_immediate=3, flammable=2, sapling=1}, - sounds = default.node_sound_defaults(), + sounds = node_sounds, }) minetest.register_craft({ @@ -26,7 +26,7 @@ minetest.register_node(":moretrees:rubber_tree_trunk", { "technic_rubber_tree_full.png"}, groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2}, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, }) minetest.register_node(":moretrees:rubber_tree_trunk_empty", { @@ -35,7 +35,7 @@ minetest.register_node(":moretrees:rubber_tree_trunk_empty", { "technic_rubber_tree_empty.png"}, groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), + sounds = wood_sounds, }) minetest.register_node(":moretrees:rubber_tree_leaves", { @@ -55,7 +55,7 @@ minetest.register_node(":moretrees:rubber_tree_leaves", { } } }, - sounds = default.node_sound_leaves_defaults(), + sounds = leaves_sounds, }) technic.rubber_tree_model={ diff --git a/wrench/mod.conf b/wrench/mod.conf index a18b4f7..b292c49 100644 --- a/wrench/mod.conf +++ b/wrench/mod.conf @@ -1,3 +1,3 @@ name = wrench -depends = default -optional_depends = technic, technic_chests, technic_worldgen, intllib +optional_depends = technic, technic_chests, technic_worldgen, intllib, default, mcl_core +supported_games = minetest_game,mineclone2 \ No newline at end of file diff --git a/wrench/support.lua b/wrench/support.lua index 78ffa03..80df230 100644 --- a/wrench/support.lua +++ b/wrench/support.lua @@ -23,7 +23,7 @@ local STRING, FLOAT = wrench.META_TYPE_FLOAT wrench.registered_nodes = { - ["default:chest"] = { + [chest_ingrediant] = { lists = {"main"}, }, ["default:chest_locked"] = { From 9d0b609c6be5a6214e389327790be3eb03377b69 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Wed, 20 Dec 2023 11:24:29 +0000 Subject: [PATCH 02/32] 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 From 535c130bae7e15147dddfeb13b6563c866882e0f Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Wed, 20 Dec 2023 12:07:07 +0000 Subject: [PATCH 03/32] Moved Mineclone2 support for technic to seperate lua file --- technic/init.lua | 394 +--------------------------------------- technic/mcl_support.lua | 391 +++++++++++++++++++++++++++++++++++++++ technic/mod.conf | 2 +- 3 files changed, 396 insertions(+), 391 deletions(-) create mode 100644 technic/mcl_support.lua diff --git a/technic/init.lua b/technic/init.lua index 4177c90..3a38b4f 100644 --- a/technic/init.lua +++ b/technic/init.lua @@ -1,397 +1,7 @@ -- namespace: technic -- (c) 2012-2013 by RealBadAngel --- Mineclone2 Support -stone_sounds = nil -if minetest.get_modpath("mcl_sounds") then - stone_sounds = mcl_sounds.node_sound_stone_defaults() -else - stone_sounds = default.node_sound_stone_defaults() -end -mt_light_max = nil -if minetest.get_modpath("mcl_core") then - mt_light_max = mcl_core.LIGHT_MAX -else - mt_light_max = default.LIGHT_MAX -end - -copper_ingrediant = nil -if minetest.get_modpath("mcl_core") then - copper_ingrediant = "mcl_copper:copper_ingot" -else - copper_ingrediant = 'default:copper_ingot' -end - -iron_ingrediant = nil -if minetest.get_modpath("mcl_core") then - iron_ingrediant = "mcl_core:iron_ingot" -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" -else - mese_crystal_ingrediant = 'default:mese_crystal' -end - -diamond_ingrediant = nil -if minetest.get_modpath("mcl_core") then - diamond_ingrediant = "mcl_core:diamond" -else - diamond_ingrediant = 'default:diamond' -end - -glass_ingrediant = nil -if minetest.get_modpath("mcl_core") then - glass_ingrediant = "mcl_core:glass" -else - glass_ingrediant = 'default:glass' -end - -brick_block_ingrediant = nil -if minetest.get_modpath("mcl_core") then - brick_block_ingrediant = "mcl_core:brick_block" -else - brick_block_ingrediant = 'default:brick' -end - -mese_block_ingrediant = nil -if minetest.get_modpath("mcl_core") then - mese_block_ingrediant = "mesecons_torch:redstoneblock" -else - mese_block_ingrediant = "default:mese" -end - - -paper_ingrediant = nil -if minetest.get_modpath("mcl_core") then - paper_ingrediant = "mcl_core:paper" -else - paper_ingrediant = 'default:paper' -end - - -obsidian_glass_ingrediant = nil -if minetest.get_modpath("mcl_core") then - obsidian_glass_ingrediant = "mcl_core:obsidian" -else - obsidian_glass_ingrediant = 'default:obsidian_glass' -end - -obsidian_ingrediant = nil -if minetest.get_modpath("mcl_core") then - obsidian_ingrediant = "mcl_core:obsidian" -else - obsidian_ingrediant = 'default:obsidian' -end - -green_dye_ingrediant = nil -if minetest.get_modpath("mcl_core") then - green_dye_ingrediant = "mcl_dye:green" -else - green_dye_ingrediant = 'dye:green' -end - -blue_dye_ingrediant = nil -if minetest.get_modpath("mcl_core") then - blue_dye_ingrediant = "mcl_dye:blue" -else - blue_dye_ingrediant = 'dye:blue' -end - -red_dye_ingrediant = nil -if minetest.get_modpath("mcl_core") then - red_dye_ingrediant = "mcl_dye:red" -else - red_dye_ingrediant = 'dye:red' -end - -white_dye_ingrediant = nil -if minetest.get_modpath("mcl_core") then - white_dye_ingrediant = "mcl_dye:white" -else - white_dye_ingrediant = 'dye:white' -end - -gold_ingot_ingrediant = nil -if minetest.get_modpath("mcl_core") then - gold_ingot_ingrediant = "mcl_core:gold_ingot" -else - gold_ingot_ingrediant = 'default:gold_ingot' -end - -chest_ingrediant = nil -if minetest.get_modpath("mcl_core") then - chest_ingrediant = "mcl_chests:chest" -else - chest_ingrediant = "default:chest" -end - -stone_ingrediant = nil -if minetest.get_modpath("mcl_core") then - stone_ingrediant = "mcl_core:stone" -else - stone_ingrediant = "default:stone" -end - -wood_fence_ingrediant = nil -if minetest.get_modpath("mcl_core") then - wood_fence_ingrediant = "group:fence_wood" -else - wood_fence_ingrediant = "default:fence_wood" -end - - -diamond_ingrediant = nil -if minetest.get_modpath("mcl_core") then - diamond_ingrediant = "mcl_core:diamond" -else - diamond_ingrediant = "default:diamond" -end - -bronze_ingrediant = nil -if minetest.get_modpath("mcl_core") then - bronze_ingrediant = "mcl_copper:copper_ingot" -else - bronze_ingrediant = 'default:bronze_ingot' -end - -tin_ingrediant = nil -if minetest.get_modpath("mcl_core") then - tin_ingrediant = "moreores:tin_ingot" -else - tin_ingrediant = 'default:tin_ingot' -end - -sandstone_ingrediant = nil -if minetest.get_modpath("mcl_core") then - sandstone_ingrediant = "mcl_core:sandstone" -else - sandstone_ingrediant = 'default:desert_stone' -end - -sand_ingrediant = nil -if minetest.get_modpath("mcl_core") then - sand_ingrediant = "mcl_core:sand" -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" -else - desert_stone_ingrediant = 'default:desert_stone' -end - -desert_sand_ingrediant = nil -if minetest.get_modpath("mcl_core") then - desert_sand_ingrediant = "mcl_core:redsand" -else - desert_sand_ingrediant = 'default:desert_sand' -end - - - -furnace_ingrediant = nil -if minetest.get_modpath("mcl_core") then - furnace_ingrediant = "mcl_furnaces:furnace" -else - furnace_ingrediant = 'default:furnace' -end - -mossy_cobble_ingrediant = nil -if minetest.get_modpath("mcl_core") then - mossy_cobble_ingrediant = "mcl_core:mossycobble" -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" -else - snow_block_ingrediant = 'default:snowblock' -end - -ice_block_ingrediant = nil -if minetest.get_modpath("mcl_core") then - ice_block_ingrediant = "mcl_core:ice" -else - ice_block_ingrediant = 'default:ice' -end - -granite_ingrediant = nil -if minetest.get_modpath("mcl_core") then - granite_ingrediant = "mcl_core:granite" -else - granite_ingrediant = 'technic:granite' -end - -granite_bricks_ingrediant = nil -if minetest.get_modpath("mcl_core") then - granite_bricks_ingrediant = "mcl_core:granite_smooth" -else - granite_bricks_ingrediant = 'technic:granite_bricks' -end - -coal_ingrediant = nil -if minetest.get_modpath("mcl_core") then - coal_ingrediant = "group:coal" -else - coal_ingrediant = "default:coal_lump" -end - -dirt_ingrediant = nil -if minetest.get_modpath("mcl_core") then - dirt_ingrediant = "mcl_core:dirt" -else - dirt_ingrediant = "default:dirt" -end - -mesecons_fiber_ingrediant = nil - -if minetest.get_modpath("mcl_core") then - mesecons_fiber_ingrediant = "mesecons:wire_00000000_off" -else - mesecons_fiber_ingrediant = "mesecons_materials:fiber" -end - -stick_ingrediant = nil - -if minetest.get_modpath("mcl_core") then - stick_ingrediant = "mcl_core:stick" -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 @@ -433,6 +43,10 @@ local S = technic.getter -- Read configuration file dofile(modpath.."/config.lua") + +-- MineClone2 Support +dofile(modpath.."/mcl_support.lua") + -- Helper functions dofile(modpath.."/helpers.lua") diff --git a/technic/mcl_support.lua b/technic/mcl_support.lua new file mode 100644 index 0000000..0d58494 --- /dev/null +++ b/technic/mcl_support.lua @@ -0,0 +1,391 @@ +-- Mineclone2 Support +stone_sounds = nil +if minetest.get_modpath("mcl_sounds") then + stone_sounds = mcl_sounds.node_sound_stone_defaults() +else + stone_sounds = default.node_sound_stone_defaults() +end + +mt_light_max = nil +if minetest.get_modpath("mcl_core") then + mt_light_max = mcl_core.LIGHT_MAX +else + mt_light_max = default.LIGHT_MAX +end + +copper_ingrediant = nil +if minetest.get_modpath("mcl_core") then + copper_ingrediant = "mcl_copper:copper_ingot" +else + copper_ingrediant = 'default:copper_ingot' +end + +iron_ingrediant = nil +if minetest.get_modpath("mcl_core") then + iron_ingrediant = "mcl_core:iron_ingot" +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" +else + mese_crystal_ingrediant = 'default:mese_crystal' +end + +diamond_ingrediant = nil +if minetest.get_modpath("mcl_core") then + diamond_ingrediant = "mcl_core:diamond" +else + diamond_ingrediant = 'default:diamond' +end + +glass_ingrediant = nil +if minetest.get_modpath("mcl_core") then + glass_ingrediant = "mcl_core:glass" +else + glass_ingrediant = 'default:glass' +end + +brick_block_ingrediant = nil +if minetest.get_modpath("mcl_core") then + brick_block_ingrediant = "mcl_core:brick_block" +else + brick_block_ingrediant = 'default:brick' +end + +mese_block_ingrediant = nil +if minetest.get_modpath("mcl_core") then + mese_block_ingrediant = "mesecons_torch:redstoneblock" +else + mese_block_ingrediant = "default:mese" +end + + +paper_ingrediant = nil +if minetest.get_modpath("mcl_core") then + paper_ingrediant = "mcl_core:paper" +else + paper_ingrediant = 'default:paper' +end + + +obsidian_glass_ingrediant = nil +if minetest.get_modpath("mcl_core") then + obsidian_glass_ingrediant = "mcl_core:obsidian" +else + obsidian_glass_ingrediant = 'default:obsidian_glass' +end + +obsidian_ingrediant = nil +if minetest.get_modpath("mcl_core") then + obsidian_ingrediant = "mcl_core:obsidian" +else + obsidian_ingrediant = 'default:obsidian' +end + +green_dye_ingrediant = nil +if minetest.get_modpath("mcl_core") then + green_dye_ingrediant = "mcl_dye:green" +else + green_dye_ingrediant = 'dye:green' +end + +blue_dye_ingrediant = nil +if minetest.get_modpath("mcl_core") then + blue_dye_ingrediant = "mcl_dye:blue" +else + blue_dye_ingrediant = 'dye:blue' +end + +red_dye_ingrediant = nil +if minetest.get_modpath("mcl_core") then + red_dye_ingrediant = "mcl_dye:red" +else + red_dye_ingrediant = 'dye:red' +end + +white_dye_ingrediant = nil +if minetest.get_modpath("mcl_core") then + white_dye_ingrediant = "mcl_dye:white" +else + white_dye_ingrediant = 'dye:white' +end + +gold_ingot_ingrediant = nil +if minetest.get_modpath("mcl_core") then + gold_ingot_ingrediant = "mcl_core:gold_ingot" +else + gold_ingot_ingrediant = 'default:gold_ingot' +end + +chest_ingrediant = nil +if minetest.get_modpath("mcl_core") then + chest_ingrediant = "mcl_chests:chest" +else + chest_ingrediant = "default:chest" +end + +stone_ingrediant = nil +if minetest.get_modpath("mcl_core") then + stone_ingrediant = "mcl_core:stone" +else + stone_ingrediant = "default:stone" +end + +wood_fence_ingrediant = nil +if minetest.get_modpath("mcl_core") then + wood_fence_ingrediant = "group:fence_wood" +else + wood_fence_ingrediant = "default:fence_wood" +end + + +diamond_ingrediant = nil +if minetest.get_modpath("mcl_core") then + diamond_ingrediant = "mcl_core:diamond" +else + diamond_ingrediant = "default:diamond" +end + +bronze_ingrediant = nil +if minetest.get_modpath("mcl_core") then + bronze_ingrediant = "mcl_copper:copper_ingot" +else + bronze_ingrediant = 'default:bronze_ingot' +end + +tin_ingrediant = nil +if minetest.get_modpath("mcl_core") then + tin_ingrediant = "moreores:tin_ingot" +else + tin_ingrediant = 'default:tin_ingot' +end + +sandstone_ingrediant = nil +if minetest.get_modpath("mcl_core") then + sandstone_ingrediant = "mcl_core:sandstone" +else + sandstone_ingrediant = 'default:desert_stone' +end + +sand_ingrediant = nil +if minetest.get_modpath("mcl_core") then + sand_ingrediant = "mcl_core:sand" +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" +else + desert_stone_ingrediant = 'default:desert_stone' +end + +desert_sand_ingrediant = nil +if minetest.get_modpath("mcl_core") then + desert_sand_ingrediant = "mcl_core:redsand" +else + desert_sand_ingrediant = 'default:desert_sand' +end + + + +furnace_ingrediant = nil +if minetest.get_modpath("mcl_core") then + furnace_ingrediant = "mcl_furnaces:furnace" +else + furnace_ingrediant = 'default:furnace' +end + +mossy_cobble_ingrediant = nil +if minetest.get_modpath("mcl_core") then + mossy_cobble_ingrediant = "mcl_core:mossycobble" +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" +else + snow_block_ingrediant = 'default:snowblock' +end + +ice_block_ingrediant = nil +if minetest.get_modpath("mcl_core") then + ice_block_ingrediant = "mcl_core:ice" +else + ice_block_ingrediant = 'default:ice' +end + +granite_ingrediant = nil +if minetest.get_modpath("mcl_core") then + granite_ingrediant = "mcl_core:granite" +else + granite_ingrediant = 'technic:granite' +end + +granite_bricks_ingrediant = nil +if minetest.get_modpath("mcl_core") then + granite_bricks_ingrediant = "mcl_core:granite_smooth" +else + granite_bricks_ingrediant = 'technic:granite_bricks' +end + +coal_ingrediant = nil +if minetest.get_modpath("mcl_core") then + coal_ingrediant = "group:coal" +else + coal_ingrediant = "default:coal_lump" +end + +dirt_ingrediant = nil +if minetest.get_modpath("mcl_core") then + dirt_ingrediant = "mcl_core:dirt" +else + dirt_ingrediant = "default:dirt" +end + +mesecons_fiber_ingrediant = nil + +if minetest.get_modpath("mcl_core") then + mesecons_fiber_ingrediant = "mesecons:wire_00000000_off" +else + mesecons_fiber_ingrediant = "mesecons_materials:fiber" +end + +stick_ingrediant = nil + +if minetest.get_modpath("mcl_core") then + stick_ingrediant = "mcl_core:stick" +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 \ No newline at end of file diff --git a/technic/mod.conf b/technic/mod.conf index 9fe34cc..c4347b0 100644 --- a/technic/mod.conf +++ b/technic/mod.conf @@ -1,4 +1,4 @@ name = technic depends = pipeworks, technic_worldgen, basic_materials -optional_depends = bucket, default, screwdriver, mesecons,mesecons_torch, mesecons_mvps, digilines, digiline_remote, intllib, unified_inventory, vector_extras, dye, craftguide,i3 +optional_depends = bucket, default, screwdriver, mesecons,mesecons_torch, mesecons_mvps, digilines, digiline_remote, intllib, unified_inventory, vector_extras, dye, craftguide,i3, mcl_core supported_games = minetest_game,mineclone2 \ No newline at end of file From ff885f52ff87f1d3f0441d8b68845c99083c12c2 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Wed, 20 Dec 2023 12:17:33 +0000 Subject: [PATCH 04/32] Optomised code in mcl_support.lua --- technic/mcl_support.lua | 393 ++++++---------------------------------- 1 file changed, 51 insertions(+), 342 deletions(-) diff --git a/technic/mcl_support.lua b/technic/mcl_support.lua index 0d58494..17693a8 100644 --- a/technic/mcl_support.lua +++ b/technic/mcl_support.lua @@ -1,335 +1,64 @@ +local default = minetest.get_modpath("default") and default or {} -- Mineclone2 Support -stone_sounds = nil -if minetest.get_modpath("mcl_sounds") then - stone_sounds = mcl_sounds.node_sound_stone_defaults() -else - stone_sounds = default.node_sound_stone_defaults() -end - -mt_light_max = nil -if minetest.get_modpath("mcl_core") then - mt_light_max = mcl_core.LIGHT_MAX -else - mt_light_max = default.LIGHT_MAX -end - -copper_ingrediant = nil -if minetest.get_modpath("mcl_core") then - copper_ingrediant = "mcl_copper:copper_ingot" -else - copper_ingrediant = 'default:copper_ingot' -end - -iron_ingrediant = nil -if minetest.get_modpath("mcl_core") then - iron_ingrediant = "mcl_core:iron_ingot" -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" -else - mese_crystal_ingrediant = 'default:mese_crystal' -end - -diamond_ingrediant = nil -if minetest.get_modpath("mcl_core") then - diamond_ingrediant = "mcl_core:diamond" -else - diamond_ingrediant = 'default:diamond' -end - -glass_ingrediant = nil -if minetest.get_modpath("mcl_core") then - glass_ingrediant = "mcl_core:glass" -else - glass_ingrediant = 'default:glass' -end - -brick_block_ingrediant = nil -if minetest.get_modpath("mcl_core") then - brick_block_ingrediant = "mcl_core:brick_block" -else - brick_block_ingrediant = 'default:brick' -end - -mese_block_ingrediant = nil -if minetest.get_modpath("mcl_core") then - mese_block_ingrediant = "mesecons_torch:redstoneblock" -else - mese_block_ingrediant = "default:mese" -end - - -paper_ingrediant = nil -if minetest.get_modpath("mcl_core") then - paper_ingrediant = "mcl_core:paper" -else - paper_ingrediant = 'default:paper' -end - - -obsidian_glass_ingrediant = nil -if minetest.get_modpath("mcl_core") then - obsidian_glass_ingrediant = "mcl_core:obsidian" -else - obsidian_glass_ingrediant = 'default:obsidian_glass' -end - -obsidian_ingrediant = nil -if minetest.get_modpath("mcl_core") then - obsidian_ingrediant = "mcl_core:obsidian" -else - obsidian_ingrediant = 'default:obsidian' -end - -green_dye_ingrediant = nil -if minetest.get_modpath("mcl_core") then - green_dye_ingrediant = "mcl_dye:green" -else - green_dye_ingrediant = 'dye:green' -end - -blue_dye_ingrediant = nil -if minetest.get_modpath("mcl_core") then - blue_dye_ingrediant = "mcl_dye:blue" -else - blue_dye_ingrediant = 'dye:blue' -end - -red_dye_ingrediant = nil -if minetest.get_modpath("mcl_core") then - red_dye_ingrediant = "mcl_dye:red" -else - red_dye_ingrediant = 'dye:red' -end - -white_dye_ingrediant = nil -if minetest.get_modpath("mcl_core") then - white_dye_ingrediant = "mcl_dye:white" -else - white_dye_ingrediant = 'dye:white' -end - -gold_ingot_ingrediant = nil -if minetest.get_modpath("mcl_core") then - gold_ingot_ingrediant = "mcl_core:gold_ingot" -else - gold_ingot_ingrediant = 'default:gold_ingot' -end - -chest_ingrediant = nil -if minetest.get_modpath("mcl_core") then - chest_ingrediant = "mcl_chests:chest" -else - chest_ingrediant = "default:chest" -end - -stone_ingrediant = nil -if minetest.get_modpath("mcl_core") then - stone_ingrediant = "mcl_core:stone" -else - stone_ingrediant = "default:stone" -end - -wood_fence_ingrediant = nil -if minetest.get_modpath("mcl_core") then - wood_fence_ingrediant = "group:fence_wood" -else - wood_fence_ingrediant = "default:fence_wood" -end - - -diamond_ingrediant = nil -if minetest.get_modpath("mcl_core") then - diamond_ingrediant = "mcl_core:diamond" -else - diamond_ingrediant = "default:diamond" -end - -bronze_ingrediant = nil -if minetest.get_modpath("mcl_core") then - bronze_ingrediant = "mcl_copper:copper_ingot" -else - bronze_ingrediant = 'default:bronze_ingot' -end - -tin_ingrediant = nil -if minetest.get_modpath("mcl_core") then - tin_ingrediant = "moreores:tin_ingot" -else - tin_ingrediant = 'default:tin_ingot' -end - -sandstone_ingrediant = nil -if minetest.get_modpath("mcl_core") then - sandstone_ingrediant = "mcl_core:sandstone" -else - sandstone_ingrediant = 'default:desert_stone' -end - -sand_ingrediant = nil -if minetest.get_modpath("mcl_core") then - sand_ingrediant = "mcl_core:sand" -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" -else - desert_stone_ingrediant = 'default:desert_stone' -end - -desert_sand_ingrediant = nil -if minetest.get_modpath("mcl_core") then - desert_sand_ingrediant = "mcl_core:redsand" -else - desert_sand_ingrediant = 'default:desert_sand' -end - - - -furnace_ingrediant = nil -if minetest.get_modpath("mcl_core") then - furnace_ingrediant = "mcl_furnaces:furnace" -else - furnace_ingrediant = 'default:furnace' -end - -mossy_cobble_ingrediant = nil -if minetest.get_modpath("mcl_core") then - mossy_cobble_ingrediant = "mcl_core:mossycobble" -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" -else - snow_block_ingrediant = 'default:snowblock' -end - -ice_block_ingrediant = nil -if minetest.get_modpath("mcl_core") then - ice_block_ingrediant = "mcl_core:ice" -else - ice_block_ingrediant = 'default:ice' -end - -granite_ingrediant = nil -if minetest.get_modpath("mcl_core") then - granite_ingrediant = "mcl_core:granite" -else - granite_ingrediant = 'technic:granite' -end - -granite_bricks_ingrediant = nil -if minetest.get_modpath("mcl_core") then - granite_bricks_ingrediant = "mcl_core:granite_smooth" -else - granite_bricks_ingrediant = 'technic:granite_bricks' -end - -coal_ingrediant = nil -if minetest.get_modpath("mcl_core") then - coal_ingrediant = "group:coal" -else - coal_ingrediant = "default:coal_lump" -end - -dirt_ingrediant = nil -if minetest.get_modpath("mcl_core") then - dirt_ingrediant = "mcl_core:dirt" -else - dirt_ingrediant = "default:dirt" -end - -mesecons_fiber_ingrediant = nil - -if minetest.get_modpath("mcl_core") then - mesecons_fiber_ingrediant = "mesecons:wire_00000000_off" -else - mesecons_fiber_ingrediant = "mesecons_materials:fiber" -end - -stick_ingrediant = nil - -if minetest.get_modpath("mcl_core") then - stick_ingrediant = "mcl_core:stick" -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 +stone_sounds = minetest.get_modpath("mcl_sounds") and mcl_sounds.node_sound_stone_defaults() or default.node_sound_stone_defaults() +mt_light_max = minetest.get_modpath("mcl_core") and mcl_core.LIGHT_MAX or default.LIGHT_MAX +copper_ingrediant = minetest.get_modpath("mcl_core") and "mcl_copper:copper_ingot" or 'default:copper_ingot' +iron_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:iron_ingot" or 'default:steel_ingot' +iron_lump_ingrediant = minetest.get_modpath("mcl_core") and "mcl_raw_ores:raw_iron" or 'default:iron_lump' +gold_lump_ingrediant = minetest.get_modpath("mcl_core") and "mcl_raw_ores:raw_gold" or 'default:gold_lump' +copper_lump_ingrediant = minetest.get_modpath("mcl_core") and "mcl_raw_ores:raw_copper" or 'default:copper_lump' +mese_crystal_ingrediant = minetest.get_modpath("mcl_core") and "mesecons:wire_00000000_off" or 'default:mese_crystal' +diamond_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:diamond" or 'default:diamond' +glass_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:glass" or 'default:glass' +brick_block_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:brick_block" or 'default:brick' +mese_block_ingrediant = minetest.get_modpath("mcl_core") and "mesecons_torch:redstoneblock" or "default:mese" +paper_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:paper" or 'default:paper' +obsidian_glass_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:obsidian" or 'default:obsidian_glass' +obsidian_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:obsidian" or 'default:obsidian' +green_dye_ingrediant = minetest.get_modpath("mcl_core") and "mcl_dye:green" or 'dye:green' +blue_dye_ingrediant = minetest.get_modpath("mcl_core") and "mcl_dye:blue" or 'dye:blue' +red_dye_ingrediant = minetest.get_modpath("mcl_core") and "mcl_dye:red" or 'dye:red' +white_dye_ingrediant = minetest.get_modpath("mcl_core") and "mcl_dye:white" or 'dye:white' +gold_ingot_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:gold_ingot" or 'default:gold_ingot' +chest_ingrediant = minetest.get_modpath("mcl_core") and "mcl_chests:chest" or "default:chest" +stone_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:stone" or "default:stone" +wood_fence_ingrediant = minetest.get_modpath("mcl_core") and "group:fence_wood" or "default:fence_wood" +diamond_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:diamond" or "default:diamond" +bronze_ingrediant = minetest.get_modpath("mcl_core") and "mcl_copper:copper_ingot" or 'default:bronze_ingot' +tin_ingrediant = minetest.get_modpath("mcl_core") and "moreores:tin_ingot" or 'default:tin_ingot' +sandstone_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:sandstone" or 'default:desert_stone' +sand_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:sand" or 'default:sand' +gravel_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:gravel" or 'default:gravel' +desert_stone_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:redsandstone" or 'default:desert_stone' +desert_sand_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:redsand" or 'default:desert_sand' +furnace_ingrediant = minetest.get_modpath("mcl_core") and "mcl_furnaces:furnace" or 'default:furnace' +mossy_cobble_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:mossycobble" or 'default:mossycobble' +cobble_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:cobble" or 'default:cobble' +snow_block_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:snowblock" or 'default:snowblock' +ice_block_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:ice" or 'default:ice' +granite_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:granite" or 'technic:granite' +granite_bricks_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:granite_smooth" or 'technic:granite_bricks' +coal_ingrediant = minetest.get_modpath("mcl_core") and "group:coal" or "default:coal_lump" +dirt_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:dirt" or "default:dirt" +mesecons_fiber_ingrediant = minetest.get_modpath("mcl_core") and "mesecons:wire_00000000_off" or "mesecons_materials:fiber" +stick_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:stick" or "default:stick" +emtpy_bucket_ingrediant = minetest.get_modpath("mcl_core") and "mcl_buckets:bucket_empty" or "bucket:bucket_empty" +water_bucket_ingrediant = minetest.get_modpath("mcl_core") and "mcl_buckets:bucket_water" or "bucket:bucket_water" -- Ingredient Variables - if minetest.get_modpath("mcl_core") then - blueberries_ingredient = "mcl_farming:blueberries" -- If available in MineClone2 + blueberries_ingredient = "mcl_farming:blueberries" grass_ingredient = "mcl_core:grass" dry_shrub_ingredient = "mcl_core:deadbush" - junglegrass_ingredient = "mcl_core:tallgrass" -- Adjust as needed + junglegrass_ingredient = "mcl_core:tallgrass" 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 + tulip_ingredient = "mcl_flowers:orange_tulip" 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" @@ -344,9 +73,7 @@ else 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" @@ -357,7 +84,6 @@ if minetest.get_modpath("mcl_core") then 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" @@ -369,23 +95,6 @@ else 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 \ No newline at end of file +dirt_with_snow_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:dirt_with_grass_snow" or "default:dirt_with_snow" +bucket_lava_ingrediant = minetest.get_modpath("mcl_core") and "mcl_buckets:bucket_lava" or "bucket:bucket_lava" +bucket_river_water_ingrediant = minetest.get_modpath("mcl_core") and "mcl_buckets:bucket_river_water" or "bucket:bucket_river_water" From fe3025960425cbd6356f652a0d407696115eec70 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Wed, 20 Dec 2023 12:23:29 +0000 Subject: [PATCH 05/32] Optomised code some more --- technic/mcl_support.lua | 100 ++++++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 49 deletions(-) diff --git a/technic/mcl_support.lua b/technic/mcl_support.lua index 17693a8..20f3ff6 100644 --- a/technic/mcl_support.lua +++ b/technic/mcl_support.lua @@ -1,52 +1,54 @@ local default = minetest.get_modpath("default") and default or {} +local mcl_core_modpath = minetest.get_modpath("mcl_core") + -- Mineclone2 Support -stone_sounds = minetest.get_modpath("mcl_sounds") and mcl_sounds.node_sound_stone_defaults() or default.node_sound_stone_defaults() -mt_light_max = minetest.get_modpath("mcl_core") and mcl_core.LIGHT_MAX or default.LIGHT_MAX -copper_ingrediant = minetest.get_modpath("mcl_core") and "mcl_copper:copper_ingot" or 'default:copper_ingot' -iron_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:iron_ingot" or 'default:steel_ingot' -iron_lump_ingrediant = minetest.get_modpath("mcl_core") and "mcl_raw_ores:raw_iron" or 'default:iron_lump' -gold_lump_ingrediant = minetest.get_modpath("mcl_core") and "mcl_raw_ores:raw_gold" or 'default:gold_lump' -copper_lump_ingrediant = minetest.get_modpath("mcl_core") and "mcl_raw_ores:raw_copper" or 'default:copper_lump' -mese_crystal_ingrediant = minetest.get_modpath("mcl_core") and "mesecons:wire_00000000_off" or 'default:mese_crystal' -diamond_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:diamond" or 'default:diamond' -glass_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:glass" or 'default:glass' -brick_block_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:brick_block" or 'default:brick' -mese_block_ingrediant = minetest.get_modpath("mcl_core") and "mesecons_torch:redstoneblock" or "default:mese" -paper_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:paper" or 'default:paper' -obsidian_glass_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:obsidian" or 'default:obsidian_glass' -obsidian_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:obsidian" or 'default:obsidian' -green_dye_ingrediant = minetest.get_modpath("mcl_core") and "mcl_dye:green" or 'dye:green' -blue_dye_ingrediant = minetest.get_modpath("mcl_core") and "mcl_dye:blue" or 'dye:blue' -red_dye_ingrediant = minetest.get_modpath("mcl_core") and "mcl_dye:red" or 'dye:red' -white_dye_ingrediant = minetest.get_modpath("mcl_core") and "mcl_dye:white" or 'dye:white' -gold_ingot_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:gold_ingot" or 'default:gold_ingot' -chest_ingrediant = minetest.get_modpath("mcl_core") and "mcl_chests:chest" or "default:chest" -stone_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:stone" or "default:stone" -wood_fence_ingrediant = minetest.get_modpath("mcl_core") and "group:fence_wood" or "default:fence_wood" -diamond_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:diamond" or "default:diamond" -bronze_ingrediant = minetest.get_modpath("mcl_core") and "mcl_copper:copper_ingot" or 'default:bronze_ingot' -tin_ingrediant = minetest.get_modpath("mcl_core") and "moreores:tin_ingot" or 'default:tin_ingot' -sandstone_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:sandstone" or 'default:desert_stone' -sand_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:sand" or 'default:sand' -gravel_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:gravel" or 'default:gravel' -desert_stone_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:redsandstone" or 'default:desert_stone' -desert_sand_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:redsand" or 'default:desert_sand' -furnace_ingrediant = minetest.get_modpath("mcl_core") and "mcl_furnaces:furnace" or 'default:furnace' -mossy_cobble_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:mossycobble" or 'default:mossycobble' -cobble_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:cobble" or 'default:cobble' -snow_block_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:snowblock" or 'default:snowblock' -ice_block_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:ice" or 'default:ice' -granite_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:granite" or 'technic:granite' -granite_bricks_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:granite_smooth" or 'technic:granite_bricks' -coal_ingrediant = minetest.get_modpath("mcl_core") and "group:coal" or "default:coal_lump" -dirt_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:dirt" or "default:dirt" -mesecons_fiber_ingrediant = minetest.get_modpath("mcl_core") and "mesecons:wire_00000000_off" or "mesecons_materials:fiber" -stick_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:stick" or "default:stick" -emtpy_bucket_ingrediant = minetest.get_modpath("mcl_core") and "mcl_buckets:bucket_empty" or "bucket:bucket_empty" -water_bucket_ingrediant = minetest.get_modpath("mcl_core") and "mcl_buckets:bucket_water" or "bucket:bucket_water" +stone_sounds = mcl_core_modpath and mcl_sounds.node_sound_stone_defaults() or default.node_sound_stone_defaults() +mt_light_max = mcl_core_modpath and mcl_core.LIGHT_MAX or default.LIGHT_MAX +copper_ingrediant = mcl_core_modpath and "mcl_copper:copper_ingot" or 'default:copper_ingot' +iron_ingrediant = mcl_core_modpath and "mcl_core:iron_ingot" or 'default:steel_ingot' +iron_lump_ingrediant = mcl_core_modpath and "mcl_raw_ores:raw_iron" or 'default:iron_lump' +gold_lump_ingrediant = mcl_core_modpath and "mcl_raw_ores:raw_gold" or 'default:gold_lump' +copper_lump_ingrediant = mcl_core_modpath and "mcl_raw_ores:raw_copper" or 'default:copper_lump' +mese_crystal_ingrediant = mcl_core_modpath and "mesecons:wire_00000000_off" or 'default:mese_crystal' +diamond_ingrediant = mcl_core_modpath and "mcl_core:diamond" or 'default:diamond' +glass_ingrediant = mcl_core_modpath and "mcl_core:glass" or 'default:glass' +brick_block_ingrediant = mcl_core_modpath and "mcl_core:brick_block" or 'default:brick' +mese_block_ingrediant = mcl_core_modpath and "mesecons_torch:redstoneblock" or "default:mese" +paper_ingrediant = mcl_core_modpath and "mcl_core:paper" or 'default:paper' +obsidian_glass_ingrediant = mcl_core_modpath and "mcl_core:obsidian" or 'default:obsidian_glass' +obsidian_ingrediant = mcl_core_modpath and "mcl_core:obsidian" or 'default:obsidian' +green_dye_ingrediant = mcl_core_modpath and "mcl_dye:green" or 'dye:green' +blue_dye_ingrediant = mcl_core_modpath and "mcl_dye:blue" or 'dye:blue' +red_dye_ingrediant = mcl_core_modpath and "mcl_dye:red" or 'dye:red' +white_dye_ingrediant = mcl_core_modpath and "mcl_dye:white" or 'dye:white' +gold_ingot_ingrediant = mcl_core_modpath and "mcl_core:gold_ingot" or 'default:gold_ingot' +chest_ingrediant = mcl_core_modpath and "mcl_chests:chest" or "default:chest" +stone_ingrediant = mcl_core_modpath and "mcl_core:stone" or "default:stone" +wood_fence_ingrediant = mcl_core_modpath and "group:fence_wood" or "default:fence_wood" +diamond_ingrediant = mcl_core_modpath and "mcl_core:diamond" or "default:diamond" +bronze_ingrediant = mcl_core_modpath and "mcl_copper:copper_ingot" or 'default:bronze_ingot' +tin_ingrediant = mcl_core_modpath and "moreores:tin_ingot" or 'default:tin_ingot' +sandstone_ingrediant = mcl_core_modpath and "mcl_core:sandstone" or 'default:desert_stone' +sand_ingrediant = mcl_core_modpath and "mcl_core:sand" or 'default:sand' +gravel_ingrediant = mcl_core_modpath and "mcl_core:gravel" or 'default:gravel' +desert_stone_ingrediant = mcl_core_modpath and "mcl_core:redsandstone" or 'default:desert_stone' +desert_sand_ingrediant = mcl_core_modpath and "mcl_core:redsand" or 'default:desert_sand' +furnace_ingrediant = mcl_core_modpath and "mcl_furnaces:furnace" or 'default:furnace' +mossy_cobble_ingrediant = mcl_core_modpath and "mcl_core:mossycobble" or 'default:mossycobble' +cobble_ingrediant = mcl_core_modpath and "mcl_core:cobble" or 'default:cobble' +snow_block_ingrediant = mcl_core_modpath and "mcl_core:snowblock" or 'default:snowblock' +ice_block_ingrediant = mcl_core_modpath and "mcl_core:ice" or 'default:ice' +granite_ingrediant = mcl_core_modpath and "mcl_core:granite" or 'technic:granite' +granite_bricks_ingrediant = mcl_core_modpath and "mcl_core:granite_smooth" or 'technic:granite_bricks' +coal_ingrediant = mcl_core_modpath and "group:coal" or "default:coal_lump" +dirt_ingrediant = mcl_core_modpath and "mcl_core:dirt" or "default:dirt" +mesecons_fiber_ingrediant = mcl_core_modpath and "mesecons:wire_00000000_off" or "mesecons_materials:fiber" +stick_ingrediant = mcl_core_modpath and "mcl_core:stick" or "default:stick" +emtpy_bucket_ingrediant = mcl_core_modpath and "mcl_buckets:bucket_empty" or "bucket:bucket_empty" +water_bucket_ingrediant = mcl_core_modpath and "mcl_buckets:bucket_water" or "bucket:bucket_water" -- Ingredient Variables -if minetest.get_modpath("mcl_core") then +if mcl_core_modpath then blueberries_ingredient = "mcl_farming:blueberries" grass_ingredient = "mcl_core:grass" dry_shrub_ingredient = "mcl_core:deadbush" @@ -73,7 +75,7 @@ else end -- Dye Output Variables -if minetest.get_modpath("mcl_core") then +if mcl_core_modpath then dye_black = "mcl_dye:black" dye_violet = "mcl_dye:violet" dye_green = "mcl_dye:green" @@ -95,6 +97,6 @@ else dye_red = "dye:red" end -dirt_with_snow_ingrediant = minetest.get_modpath("mcl_core") and "mcl_core:dirt_with_grass_snow" or "default:dirt_with_snow" -bucket_lava_ingrediant = minetest.get_modpath("mcl_core") and "mcl_buckets:bucket_lava" or "bucket:bucket_lava" -bucket_river_water_ingrediant = minetest.get_modpath("mcl_core") and "mcl_buckets:bucket_river_water" or "bucket:bucket_river_water" +dirt_with_snow_ingrediant = mcl_core_modpath and "mcl_core:dirt_with_grass_snow" or "default:dirt_with_snow" +bucket_lava_ingrediant = mcl_core_modpath and "mcl_buckets:bucket_lava" or "bucket:bucket_lava" +bucket_river_water_ingrediant = mcl_core_modpath and "mcl_buckets:bucket_river_water" or "bucket:bucket_river_water" From 35dbebb38076a85f10dc5402ba32447b42631a40 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Wed, 20 Dec 2023 14:34:00 +0000 Subject: [PATCH 06/32] More optomization --- technic_chests/init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/technic_chests/init.lua b/technic_chests/init.lua index 5a01628..8984b3e 100644 --- a/technic_chests/init.lua +++ b/technic_chests/init.lua @@ -62,6 +62,12 @@ else granite_bricks_ingrediant = 'technic:granite_bricks' end +coal_ingrediant = nil +if minetest.get_modpath("mcl_core") then + coal_ingrediant = "group:coal" +else + coal_ingrediant = "default:coal_lump" +end technic = rawget(_G, "technic") or {} technic.chests = {} From 420e63e7a6a48fd5425430de0bf85afd0c291847 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Thu, 21 Dec 2023 07:59:12 +0000 Subject: [PATCH 07/32] 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, }) From ca56acdee73ea19c404850b5c1203b763ff9e2f4 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Fri, 22 Dec 2023 04:59:02 +0000 Subject: [PATCH 08/32] Fixed blocks now minable --- technic_worldgen/nodes.lua | 46 ++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/technic_worldgen/nodes.lua b/technic_worldgen/nodes.lua index 6930874..17e61a1 100644 --- a/technic_worldgen/nodes.lua +++ b/technic_worldgen/nodes.lua @@ -91,6 +91,10 @@ minetest.register_node( ":technic:marble", { is_ground_content = true, groups = {cracky=3, marble=1}, sounds = stone_sounds, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node( ":technic:marble_bricks", { @@ -106,7 +110,11 @@ minetest.register_node(":technic:uranium_block", { tiles = { "technic_uranium_block.png" }, is_ground_content = true, groups = {uranium_block=1, cracky=1, level=2, radioactive=2}, - sounds = stone_sounds + sounds = stone_sounds, + _mcl_hardness = 5, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node(":technic:chromium_block", { @@ -114,7 +122,11 @@ minetest.register_node(":technic:chromium_block", { tiles = { "technic_chromium_block.png" }, is_ground_content = true, groups = {cracky=1, level=2}, - sounds = stone_sounds + sounds = stone_sounds, + _mcl_hardness = 4, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node(":technic:zinc_block", { @@ -122,7 +134,11 @@ minetest.register_node(":technic:zinc_block", { tiles = { "technic_zinc_block.png" }, is_ground_content = true, groups = {cracky=1, level=2}, - sounds = stone_sounds + sounds = stone_sounds, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node(":technic:lead_block", { @@ -130,7 +146,11 @@ minetest.register_node(":technic:lead_block", { tiles = { "technic_lead_block.png" }, is_ground_content = true, groups = {cracky=1, level=2}, - sounds = stone_sounds + sounds = stone_sounds, + _mcl_hardness = 5, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore, }) if minetest.get_modpath("default") then @@ -147,7 +167,11 @@ minetest.register_node(":technic:cast_iron_block", { tiles = { "technic_cast_iron_block.png" }, is_ground_content = true, groups = {cracky=1, level=2}, - sounds = stone_sounds + sounds = stone_sounds, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore, }) minetest.register_node(":technic:carbon_steel_block", { @@ -155,7 +179,11 @@ minetest.register_node(":technic:carbon_steel_block", { tiles = { "technic_carbon_steel_block.png" }, is_ground_content = true, groups = {cracky=1, level=2}, - sounds = stone_sounds + sounds = stone_sounds, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore, }) minetest.register_node(":technic:stainless_steel_block", { @@ -163,7 +191,11 @@ minetest.register_node(":technic:stainless_steel_block", { tiles = { "technic_stainless_steel_block.png" }, is_ground_content = true, groups = {cracky=1, level=2}, - sounds = stone_sounds + sounds = stone_sounds, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore, }) if minetest.get_modpath("default") then From 3ed2d96eb524626bd47bc5eee446e33a8e6ac8fc Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Fri, 22 Dec 2023 05:03:11 +0000 Subject: [PATCH 09/32] Fixed blocks not mineable --- technic_worldgen/nodes.lua | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/technic_worldgen/nodes.lua b/technic_worldgen/nodes.lua index 17e61a1..ad70d63 100644 --- a/technic_worldgen/nodes.lua +++ b/technic_worldgen/nodes.lua @@ -89,7 +89,7 @@ minetest.register_node( ":technic:marble", { description = S("Marble"), tiles = { "technic_marble.png" }, is_ground_content = true, - groups = {cracky=3, marble=1}, + groups = {cracky=3, marble=1,pickaxey=3}, sounds = stone_sounds, _mcl_hardness = 3, _mcl_blast_resistance = 3, @@ -101,15 +101,19 @@ minetest.register_node( ":technic:marble_bricks", { description = S("Marble Bricks"), tiles = { "technic_marble_bricks.png" }, is_ground_content = false, - groups = {cracky=3}, + groups = {cracky=3,pickaxey=3}, sounds = stone_sounds, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node(":technic:uranium_block", { description = S("Uranium Block"), tiles = { "technic_uranium_block.png" }, is_ground_content = true, - groups = {uranium_block=1, cracky=1, level=2, radioactive=2}, + groups = {uranium_block=1, cracky=1, level=2, radioactive=2,pickaxey=5}, sounds = stone_sounds, _mcl_hardness = 5, _mcl_blast_resistance = 3, @@ -121,7 +125,7 @@ minetest.register_node(":technic:chromium_block", { description = S("Chromium Block"), tiles = { "technic_chromium_block.png" }, is_ground_content = true, - groups = {cracky=1, level=2}, + groups = {cracky=1, level=2,pickaxey=4}, sounds = stone_sounds, _mcl_hardness = 4, _mcl_blast_resistance = 3, @@ -133,7 +137,7 @@ minetest.register_node(":technic:zinc_block", { description = S("Zinc Block"), tiles = { "technic_zinc_block.png" }, is_ground_content = true, - groups = {cracky=1, level=2}, + groups = {cracky=1, level=2,pickaxey=3}, sounds = stone_sounds, _mcl_hardness = 3, _mcl_blast_resistance = 3, @@ -145,10 +149,10 @@ minetest.register_node(":technic:lead_block", { description = S("Lead Block"), tiles = { "technic_lead_block.png" }, is_ground_content = true, - groups = {cracky=1, level=2}, + groups = {cracky=1, level=2,pickaxey=5}, sounds = stone_sounds, _mcl_hardness = 5, - _mcl_blast_resistance = 3, + _mcl_blast_resistance = 5, _mcl_silk_touch_drop = true, _mcl_fortune_drop = mcl_core.fortune_drop_ore, }) From e04bafce83b18ca06ecda4ad44e1bc097da34e1c Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Fri, 22 Dec 2023 05:15:32 +0000 Subject: [PATCH 10/32] Added Smelting recipe for making raw_latex in mineclone2 --- technic/crafts.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/technic/crafts.lua b/technic/crafts.lua index f02d670..e7e7234 100644 --- a/technic/crafts.lua +++ b/technic/crafts.lua @@ -207,3 +207,11 @@ minetest.register_craft({ type = "cooking", recipe = "technic:rubber_goo", }) + +if minetest.get_modpath("mcl_core") then +minetest.register_craft({ + output = "technic:raw_latex", + type = "cooking", + recipe = "mcl_mobitems:slimeball", +}) +end \ No newline at end of file From cca5d3bec101eac83828d3a08d76bfb3f89c80b8 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Fri, 22 Dec 2023 11:39:33 +0000 Subject: [PATCH 11/32] Made cables mineable --- technic/machines/register/cables.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/technic/machines/register/cables.lua b/technic/machines/register/cables.lua index e132819..0197648 100644 --- a/technic/machines/register/cables.lua +++ b/technic/machines/register/cables.lua @@ -141,7 +141,7 @@ function technic.register_cable(tier, size) local ltier = string.lower(tier) cable_tier["technic:"..ltier.."_cable"] = tier - local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, + local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, pickaxey=2, ["technic_"..ltier.."_cable"] = 1} local node_box = { @@ -171,6 +171,8 @@ function technic.register_cable(tier, size) "group:technic_"..ltier, "group:technic_all_tiers"}, on_construct = clear_networks, on_destruct = clear_networks, + _mcl_blast_resistance = 1.5, + _mcl_hardness = 3 }) local xyz = { From 05dc5893eee3a6332d06f53906ebaec50b0184cd Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Fri, 22 Dec 2023 11:43:42 +0000 Subject: [PATCH 12/32] Test --- technic/machines/register/cables.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/technic/machines/register/cables.lua b/technic/machines/register/cables.lua index 0197648..70058e3 100644 --- a/technic/machines/register/cables.lua +++ b/technic/machines/register/cables.lua @@ -171,8 +171,8 @@ function technic.register_cable(tier, size) "group:technic_"..ltier, "group:technic_all_tiers"}, on_construct = clear_networks, on_destruct = clear_networks, - _mcl_blast_resistance = 1.5, - _mcl_hardness = 3 + --_mcl_blast_resistance = 1.5, + --_mcl_hardness = 3 }) local xyz = { From 6a232121cb00f48de3d128c3e29916ef417d0f24 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Fri, 22 Dec 2023 11:45:13 +0000 Subject: [PATCH 13/32] Cables breakability Fixed again --- technic/machines/register/cables.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/technic/machines/register/cables.lua b/technic/machines/register/cables.lua index 70058e3..0197648 100644 --- a/technic/machines/register/cables.lua +++ b/technic/machines/register/cables.lua @@ -171,8 +171,8 @@ function technic.register_cable(tier, size) "group:technic_"..ltier, "group:technic_all_tiers"}, on_construct = clear_networks, on_destruct = clear_networks, - --_mcl_blast_resistance = 1.5, - --_mcl_hardness = 3 + _mcl_blast_resistance = 1.5, + _mcl_hardness = 3 }) local xyz = { From fae9f76d4378e264ae1818efe6a8beb81da009c8 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Fri, 22 Dec 2023 12:30:23 +0000 Subject: [PATCH 14/32] Fixed copper lump grinding recipe for mineclone2 --- technic/mcl_support.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/technic/mcl_support.lua b/technic/mcl_support.lua index 20f3ff6..2c1d36e 100644 --- a/technic/mcl_support.lua +++ b/technic/mcl_support.lua @@ -8,7 +8,7 @@ copper_ingrediant = mcl_core_modpath and "mcl_copper:copper_ingot" or 'default:c iron_ingrediant = mcl_core_modpath and "mcl_core:iron_ingot" or 'default:steel_ingot' iron_lump_ingrediant = mcl_core_modpath and "mcl_raw_ores:raw_iron" or 'default:iron_lump' gold_lump_ingrediant = mcl_core_modpath and "mcl_raw_ores:raw_gold" or 'default:gold_lump' -copper_lump_ingrediant = mcl_core_modpath and "mcl_raw_ores:raw_copper" or 'default:copper_lump' +copper_lump_ingrediant = mcl_core_modpath and "mcl_copper:raw_copper" or 'default:copper_lump' mese_crystal_ingrediant = mcl_core_modpath and "mesecons:wire_00000000_off" or 'default:mese_crystal' diamond_ingrediant = mcl_core_modpath and "mcl_core:diamond" or 'default:diamond' glass_ingrediant = mcl_core_modpath and "mcl_core:glass" or 'default:glass' From ffce3393bb9d63544ef70fa53492223733b83fc0 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Fri, 22 Dec 2023 13:45:41 +0000 Subject: [PATCH 15/32] Fixed texture errors --- technic_cnc/cnc_materials.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/technic_cnc/cnc_materials.lua b/technic_cnc/cnc_materials.lua index 2243ea2..0e20e30 100644 --- a/technic_cnc/cnc_materials.lua +++ b/technic_cnc/cnc_materials.lua @@ -5,12 +5,12 @@ local is_mcl = minetest.get_modpath("mcl_core") -- Textures and names for MineClone2 local dirt_texture = is_mcl and "default_dirt.png" or "default_dirt.png" -local grass_texture = is_mcl and "default_grass.png" or "default_grass.png" +local grass_texture = is_mcl and "mcl_core_palette_grass.png" or "default_grass.png" local wood_texture = is_mcl and "default_wood.png" or "default_wood.png" local stone_texture = is_mcl and "default_stone.png" or "default_stone.png" local cobble_texture = is_mcl and "default_cobble.png" or "default_cobble.png" local brick_texture = is_mcl and "default_brick.png" or "default_brick.png" -local sandstone_texture = is_mcl and "default_sandstone.png" or "default_sandstone.png" +local sandstone_texture = is_mcl and "mcl_core_sandstone_top.png" or "default_sandstone.png" local leaves_texture = is_mcl and "default_leaves.png" or "default_leaves.png" local tree_texture = is_mcl and "default_tree.png" or "default_tree.png" local bronzeblock_texture = is_mcl and "mcl_core_bronze_block.png" or "default_bronze_block.png" From 1087e0c6457fdb3e9f025b80c01eb7b9fef01bcc Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Wed, 27 Dec 2023 02:43:48 +0000 Subject: [PATCH 16/32] Added MCL CraftGuide for Machine recipes --- technic/init.lua | 2 + .../machines/register/centrifuge_recipes.lua | 16 +- .../machines/register/compressor_recipes.lua | 15 +- .../machines/register/extractor_recipes.lua | 25 +-- technic/machines/register/freezer_recipes.lua | 9 +- technic/machines/register/grinder_recipes.lua | 49 ++---- technic/mcl_craftguide.lua | 154 ++++++++++++++++++ technic/mod.conf | 2 +- 8 files changed, 178 insertions(+), 94 deletions(-) create mode 100644 technic/mcl_craftguide.lua diff --git a/technic/init.lua b/technic/init.lua index 3a38b4f..816a15a 100644 --- a/technic/init.lua +++ b/technic/init.lua @@ -47,6 +47,8 @@ dofile(modpath.."/config.lua") -- MineClone2 Support dofile(modpath.."/mcl_support.lua") +dofile(modpath.."/mcl_craftguide.lua") + -- Helper functions dofile(modpath.."/helpers.lua") diff --git a/technic/machines/register/centrifuge_recipes.lua b/technic/machines/register/centrifuge_recipes.lua index e9dd265..f969c57 100644 --- a/technic/machines/register/centrifuge_recipes.lua +++ b/technic/machines/register/centrifuge_recipes.lua @@ -10,31 +10,23 @@ function technic.register_separating_recipe(data) technic.register_recipe("separating", data) end -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", sand_ingrediant, "technic:uranium3_dust" }, - { dirt_ingrediant.." 4", sand_ingrediant, gravel_ingrediant, "default:clay_lump 2" }, -} - local function uranium_dust(p) return "technic:uranium"..(p == 7 and "" or p).."_dust" end for p = 1, 34 do - table.insert(recipes, { uranium_dust(p).." 2", uranium_dust(p-1), uranium_dust(p+1) }) + table.insert(centrifuge_recipes, { uranium_dust(p).." 2", uranium_dust(p-1), uranium_dust(p+1) }) end if minetest.get_modpath("bushes_classic") then for _, berry in ipairs({ "blackberry", "blueberry", "gooseberry", "raspberry", "strawberry" }) do - table.insert(recipes, { "bushes:"..berry.."_bush", "default:stick 20", "bushes:"..berry.." 4" }) + table.insert(centrifuge_recipes, { "bushes:"..berry.."_bush", "default:stick 20", "bushes:"..berry.." 4" }) end end if minetest.get_modpath("farming") then - table.insert(recipes, { "farming:wheat 4", "farming:seed_wheat 3", "default:dry_shrub 1" }) + table.insert(centrifuge_recipes, { "farming:wheat 4", "farming:seed_wheat 3", "default:dry_shrub 1" }) end -for _, data in pairs(recipes) do +for _, data in pairs(centrifuge_recipes) do technic.register_separating_recipe({ input = { data[1] }, output = { data[2], data[3], data[4] } }) end diff --git a/technic/machines/register/compressor_recipes.lua b/technic/machines/register/compressor_recipes.lua index 264abe2..3436983 100644 --- a/technic/machines/register/compressor_recipes.lua +++ b/technic/machines/register/compressor_recipes.lua @@ -8,19 +8,8 @@ function technic.register_compressor_recipe(data) technic.register_recipe("compressing", data) end -local recipes = { - {snow_block_ingrediant, ice_block_ingrediant}, - {sand_ingrediant.." 2", sandstone_ingrediant}, - {desert_sand_ingrediant.." 2", desert_stone_ingrediant}, - {desert_sand_ingrediant, desert_stone_ingrediant}, - {"technic:mixed_metal_ingot", "technic:composite_plate"}, - {copper_ingrediant.." 5", "technic:copper_plate"}, - {"technic:coal_dust 4", "technic:graphite"}, - {"technic:carbon_cloth", "technic:carbon_plate"}, - {"technic:uranium35_ingot 5", "technic:uranium_fuel"}, -} if minetest.get_modpath("default") then -table.insert(recipes, {"default:silver_sand 2", "default:silver_sandstone"}) +table.insert(compressor_recipes, {"default:silver_sand 2", "default:silver_sandstone"}) end -- defuse the default sandstone recipe, since we have the compressor to take over in a more realistic manner minetest.clear_craft({ @@ -42,7 +31,7 @@ minetest.clear_craft({ }, }) -for _, data in pairs(recipes) do +for _, data in pairs(compressor_recipes) do technic.register_compressor_recipe({input = {data[1]}, output = data[2]}) end diff --git a/technic/machines/register/extractor_recipes.lua b/technic/machines/register/extractor_recipes.lua index 6885750..cc95153 100644 --- a/technic/machines/register/extractor_recipes.lua +++ b/technic/machines/register/extractor_recipes.lua @@ -8,32 +8,11 @@ function technic.register_extractor_recipe(data) technic.register_recipe("extracting", data) end -if minetest.get_modpath("dye") then +if minetest.get_modpath("dye") or minetest.get_modpath("mcl_dye") then -- check if we are using dye or unifieddyes 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"}, - {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 ""}, - } - - - for _, data in ipairs(dye_recipes) do + for _, data in ipairs(extractor_recipes) do technic.register_extractor_recipe({input = {data[1]}, output = data[2]}) end diff --git a/technic/machines/register/freezer_recipes.lua b/technic/machines/register/freezer_recipes.lua index 59d6166..9a10c65 100644 --- a/technic/machines/register/freezer_recipes.lua +++ b/technic/machines/register/freezer_recipes.lua @@ -8,14 +8,7 @@ function technic.register_freezer_recipe(data) technic.register_recipe("freezing", data) end -local recipes = { - {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 +for _, data in pairs(freezer_recipes) do technic.register_freezer_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 8087cd7..a99ca37 100644 --- a/technic/machines/register/grinder_recipes.lua +++ b/technic/machines/register/grinder_recipes.lua @@ -8,35 +8,10 @@ function technic.register_grinder_recipe(data) technic.register_recipe("grinding", data) end -local recipes = { - -- 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 - {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"}) + table.insert(grinder_recipes, {"default:silver_sandstone", "default:silver_sand 2"}) -- reverse recipe can be found in the compressor + table.insert(grinder_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) @@ -57,27 +32,27 @@ minetest.clear_craft({ }) if minetest.get_modpath("farming") then - table.insert(recipes, {"farming:seed_wheat", "farming:flour 1"}) + table.insert(grinder_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"}) + table.insert(grinder_recipes, {"moreores:mithril_lump", "technic:mithril_dust 2"}) + table.insert(grinder_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"}) + table.insert(grinder_recipes, {"gloopores:alatro_lump", "technic:alatro_dust 2"}) + table.insert(grinder_recipes, {"gloopores:kalite_lump", "technic:kalite_dust 2"}) + table.insert(grinder_recipes, {"gloopores:arol_lump", "technic:arol_dust 2"}) + table.insert(grinder_recipes, {"gloopores:talinite_lump", "technic:talinite_dust 2"}) + table.insert(grinder_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"}) + table.insert(grinder_recipes, {"home_decor:brass_ingot", "technic:brass_dust 1"}) end -for _, data in pairs(recipes) do +for _, data in pairs(grinder_recipes) do technic.register_grinder_recipe({input = {data[1]}, output = data[2]}) end diff --git a/technic/mcl_craftguide.lua b/technic/mcl_craftguide.lua new file mode 100644 index 0000000..2c170b9 --- /dev/null +++ b/technic/mcl_craftguide.lua @@ -0,0 +1,154 @@ +-- Register craft types for each machine +mcl_craftguide.register_craft_type("centrifuge", { + description = "Centrifuge", + icon = "technic_mv_centrifuge_front_active.png", +}) + +mcl_craftguide.register_craft_type("compressor", { + description = "Compressor", + icon = "technic_lv_compressor_front_active.png", +}) + +mcl_craftguide.register_craft_type("extractor", { + description = "Extractor", + icon = "technic_lv_extractor_front_active.png", +}) + +mcl_craftguide.register_craft_type("freezer", { + description = "Freezer", + icon = "technic_mv_freezer_front_active.png", +}) + +mcl_craftguide.register_craft_type("grinder", { + description = "Grinder", + icon = "technic_lv_grinder_front_active.png", +}) + + +centrifuge_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", sand_ingrediant, "technic:uranium3_dust" }, + { dirt_ingrediant.." 4", sand_ingrediant, gravel_ingrediant, "default:clay_lump 2" }, +} + +compressor_recipes = { + {snow_block_ingrediant, ice_block_ingrediant}, + {sand_ingrediant.." 2", sandstone_ingrediant}, + {desert_sand_ingrediant.." 2", desert_stone_ingrediant}, + {desert_sand_ingrediant, desert_stone_ingrediant}, + {"technic:mixed_metal_ingot", "technic:composite_plate"}, + {copper_ingrediant.." 5", "technic:copper_plate"}, + {"technic:coal_dust 4", "technic:graphite"}, + {"technic:carbon_cloth", "technic:carbon_plate"}, + {"technic:uranium35_ingot 5", "technic:uranium_fuel"}, +} + +extractor_recipes = { + {"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 ""}, +} + +freezer_recipes = { + {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 } } +} + +grinder_recipes = { + -- 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 + {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}, +} + +-- Register Centrifuge Recipes +for _, data in pairs(centrifuge_recipes) do + mcl_craftguide.register_craft({ + type = "centrifuge", + width = 1, + output = table.concat({data[2], data[3], data[4]}, " "), + items = {data[1]}, + }) +end + +-- Register Compressor Recipes +for _, data in pairs(compressor_recipes) do + mcl_craftguide.register_craft({ + type = "compressor", + width = 1, + output = data[2], + items = {data[1]}, + }) +end + +-- Register Extractor Recipes +for _, data in ipairs(extractor_recipes) do + mcl_craftguide.register_craft({ + type = "extractor", + width = 1, + output = data[2], + items = {data[1]}, + }) +end + +-- Register Freezer Recipes +for _, data in pairs(freezer_recipes) do + local output_string + if type(data[2]) == "table" then + output_string = table.concat(data[2], ", ") + else + output_string = data[2] + end + + mcl_craftguide.register_craft({ + type = "freezer", + width = 1, + output = output_string, + items = {data[1]}, + }) +end + + +-- Register Grinder Recipes +for _, data in pairs(grinder_recipes) do + mcl_craftguide.register_craft({ + type = "grinder", + width = 1, + output = data[2], + items = {data[1]}, + }) +end + diff --git a/technic/mod.conf b/technic/mod.conf index c4347b0..480451a 100644 --- a/technic/mod.conf +++ b/technic/mod.conf @@ -1,4 +1,4 @@ name = technic depends = pipeworks, technic_worldgen, basic_materials -optional_depends = bucket, default, screwdriver, mesecons,mesecons_torch, mesecons_mvps, digilines, digiline_remote, intllib, unified_inventory, vector_extras, dye, craftguide,i3, mcl_core +optional_depends = bucket, default, screwdriver, mesecons,mesecons_torch, mesecons_mvps, digilines, digiline_remote, intllib, unified_inventory, vector_extras, dye, craftguide,i3, mcl_core, mcl_craftguide supported_games = minetest_game,mineclone2 \ No newline at end of file From 8857680d29124c8341daaa9fd3be4c65143b3293 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Wed, 27 Dec 2023 02:48:43 +0000 Subject: [PATCH 17/32] Add alloy recipes to mcl_craftrecipes --- technic/machines/register/alloy_recipes.lua | 22 +------------ technic/mcl_craftguide.lua | 34 +++++++++++++++++++++ 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/technic/machines/register/alloy_recipes.lua b/technic/machines/register/alloy_recipes.lua index 0566782..c2ffd4f 100644 --- a/technic/machines/register/alloy_recipes.lua +++ b/technic/machines/register/alloy_recipes.lua @@ -11,26 +11,6 @@ function technic.register_alloy_recipe(data) technic.register_recipe("alloy", data) end -local recipes = { - {"technic:copper_dust 7", "technic:tin_dust", "technic:bronze_dust 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}, - {"technic:carbon_steel_ingot 2", "technic:coal_dust", "technic:cast_iron_ingot 2", 6}, - {"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"}, - {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}, - {ice_block_ingrediant, emtpy_bucket_ingrediant, water_bucket_ingrediant, 1 }, -} - -for _, data in pairs(recipes) do +for _, data in pairs(alloy_recipes) do technic.register_alloy_recipe({input = {data[1], data[2]}, output = data[3], time = data[4]}) end diff --git a/technic/mcl_craftguide.lua b/technic/mcl_craftguide.lua index 2c170b9..ffa162e 100644 --- a/technic/mcl_craftguide.lua +++ b/technic/mcl_craftguide.lua @@ -24,6 +24,11 @@ mcl_craftguide.register_craft_type("grinder", { icon = "technic_lv_grinder_front_active.png", }) +mcl_craftguide.register_craft_type("alloy_furnace", { + description = "Alloy Furnace", + icon = "technic_coal_alloy_furnace_front_active.png", +}) + centrifuge_recipes = { { "technic:bronze_dust 8", "technic:copper_dust 7", "technic:tin_dust" }, @@ -94,6 +99,35 @@ grinder_recipes = { {ice_block_ingrediant, snow_block_ingrediant}, } +alloy_recipes = { + {"technic:copper_dust 7", "technic:tin_dust", "technic:bronze_dust 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}, + {"technic:carbon_steel_ingot 2", "technic:coal_dust", "technic:cast_iron_ingot 2", 6}, + {"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"}, + {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}, + {ice_block_ingrediant, emtpy_bucket_ingrediant, water_bucket_ingrediant, 1 }, +} + +for _, data in pairs(alloy_recipes) do + mcl_craftguide.register_craft({ + type = "alloy_furnace", + width = 1, + output = data[3], + items = {data[1], data[2]}, + }) +end + -- Register Centrifuge Recipes for _, data in pairs(centrifuge_recipes) do mcl_craftguide.register_craft({ From 26a8ab3dd0831f7f9474e618d1055226d4180290 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Wed, 27 Dec 2023 16:11:05 +0000 Subject: [PATCH 18/32] Various fixes reccomended by the mod author --- .luacheckrc | 4 +- concrete/init.lua | 30 ++-- concrete/mod.conf | 2 +- extranodes/init.lua | 37 ++--- extranodes/mod.conf | 2 +- refactor.py | 40 ++++++ technic/crafts.lua | 46 +++--- technic/init.lua | 5 + technic/machines/HV/forcefield.lua | 4 +- technic/machines/HV/nuclear_reactor.lua | 2 +- technic/machines/HV/quarry.lua | 1 - technic/machines/LV/alloy_furnace.lua | 6 +- technic/machines/LV/cables.lua | 6 +- technic/machines/LV/compressor.lua | 2 +- technic/machines/LV/electric_furnace.lua | 6 +- technic/machines/LV/generator.lua | 6 +- technic/machines/LV/geothermal.lua | 4 +- technic/machines/LV/grinder.lua | 6 +- technic/machines/LV/lamp.lua | 2 +- technic/machines/LV/music_player.lua | 6 +- technic/machines/LV/water_mill.lua | 2 +- technic/machines/MV/tool_workshop.lua | 4 +- technic/machines/other/coal_alloy_furnace.lua | 6 +- technic/machines/other/frames.lua | 4 +- technic/machines/other/injector.lua | 2 +- technic/machines/power_monitor.lua | 2 +- technic/machines/register/battery_box.lua | 4 +- technic/machines/register/common.lua | 4 +- .../machines/register/extractor_recipes.lua | 2 +- technic/machines/register/grinder_recipes.lua | 6 +- technic/machines/switching_station.lua | 2 +- technic/mcl_craftguide.lua | 62 ++++---- technic/mcl_support.lua | 101 +++++++------ technic/mod.conf | 2 +- technic/radiation.lua | 6 +- technic/tools/cans.lua | 4 +- technic/tools/mining_drill.lua | 4 +- technic/tools/mining_lasers.lua | 18 +-- technic/tools/sonic_screwdriver.lua | 6 +- technic/tools/tree_tap.lua | 4 +- technic_chests/copper_chest.lua | 12 +- technic_chests/gold_chest.lua | 12 +- technic_chests/init.lua | 41 +++--- technic_chests/iron_chest.lua | 2 +- technic_chests/mod.conf | 2 +- technic_cnc/cnc.lua | 6 +- technic_cnc/init.lua | 8 ++ technic_cnc/mod.conf | 2 +- technic_worldgen/init.lua | 34 +---- technic_worldgen/mod.conf | 2 +- technic_worldgen/nodes.lua | 133 +++++++++--------- technic_worldgen/rubber.lua | 8 +- wrench/init.lua | 5 + wrench/mod.conf | 2 +- wrench/support.lua | 2 +- 55 files changed, 396 insertions(+), 337 deletions(-) create mode 100644 refactor.py diff --git a/.luacheckrc b/.luacheckrc index 7191d7b..2d3e858 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -31,7 +31,9 @@ read_globals = { "protector", "isprotect", "homedecor_expect_infinite_stacks", - "craftguide", "i3" + "craftguide", "i3", + "mcl_sounds","mcl_core", + "mcl_craftguide" } -- Loop warning diff --git a/concrete/init.lua b/concrete/init.lua index f186f09..37c7483 100644 --- a/concrete/init.lua +++ b/concrete/init.lua @@ -1,26 +1,32 @@ --Minetest 0.4.7 mod: concrete --(c) 2013 by RealBadAngel +-- Boilerplate to support localized strings if intllib mod is installed. +local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end + local technic = rawget(_G, "technic") or {} technic.concrete_posts = {} --- Mineclone2 Support -local stone_ingrediant = nil -if minetest.get_modpath("mcl_core") then - stone_ingrediant = "mcl_core:stone" -else - stone_ingrediant = "default:stone" +-- Check if mcl_core or default is installed +if not minetest.get_modpath("mcl_core") and not minetest.get_modpath("default") then + error(S(minetest.get_current_modname()).." "..S("requires mcl_core or default to be installed (please install MTG or MCL2, or compatible games)")) +end + +-- Mineclone2 Support + +if minetest.get_modpath("mcl_core") then + stone_ingredient = "mcl_core:stone" +else + stone_ingredient = "default:stone" end -local stone_sounds = nil if minetest.get_modpath("mcl_sounds") then stone_sounds = mcl_sounds.node_sound_stone_defaults() else stone_sounds = default.node_sound_stone_defaults() end --- Boilerplate to support localized strings if intllib mod is installed. -local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end + for i = 0, 31 do minetest.register_alias("technic:concrete_post"..i, @@ -41,9 +47,9 @@ minetest.register_craft({ minetest.register_craft({ output = 'technic:concrete_post 12', recipe = { - {stone_ingrediant,'basic_materials:steel_bar',stone_ingrediant}, - {stone_ingrediant,'basic_materials:steel_bar',stone_ingrediant}, - {stone_ingrediant,'basic_materials:steel_bar',stone_ingrediant}, + {stone_ingredient,'basic_materials:steel_bar',stone_ingredient}, + {stone_ingredient,'basic_materials:steel_bar',stone_ingredient}, + {stone_ingredient,'basic_materials:steel_bar',stone_ingredient}, } }) diff --git a/concrete/mod.conf b/concrete/mod.conf index 6f4a76a..5a17f88 100644 --- a/concrete/mod.conf +++ b/concrete/mod.conf @@ -1,3 +1,3 @@ name = concrete optional_depends = basic_materials, intllib, moreblocks, default -supported_games = minetest_game,mineclone2 \ No newline at end of file +supported_games = minetest_game,mineclone2,mineclonia,mineclone5 \ No newline at end of file diff --git a/extranodes/init.lua b/extranodes/init.lua index ac4941c..5dd0121 100644 --- a/extranodes/init.lua +++ b/extranodes/init.lua @@ -5,19 +5,23 @@ local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end +-- Check if mcl_core or default is installed +if not minetest.get_modpath("mcl_core") and not minetest.get_modpath("default") then + error(S(minetest.get_current_modname()).." "..S("requires mcl_core or default to be installed (please install MTG or MCL2, or compatible games)")) +end + -- MineClone2 support -local stone_sounds = nil if minetest.get_modpath("mcl_sounds") then stone_sounds = mcl_sounds.node_sound_stone_defaults() else stone_sounds = default.node_sound_stone_defaults() end -wood_fence_ingrediant = nil +wood_fence_ingredient = nil if minetest.get_modpath("mcl_core") then - wood_fence_ingrediant = "group:fence_wood" + wood_fence_ingredient = "group:fence_wood" else - wood_fence_ingrediant = "default:fence_wood" + wood_fence_ingredient = "default:fence_wood" end if minetest.get_modpath("moreblocks") then @@ -126,7 +130,7 @@ end register_technic_stairs_alias("stairsplus", "concrete", "technic", "concrete") register_technic_stairs_alias("stairsplus", "marble", "technic", "marble") if not minetest.get_modpath("mcl_core") then - register_technic_stairs_alias("stairsplus", "granite", "technic", "granite") + register_technic_stairs_alias("stairsplus", "granite", "technic", "granite") end register_technic_stairs_alias("stairsplus", "marble_bricks", "technic", "marble_bricks") @@ -234,35 +238,32 @@ minetest.register_node(":technic:insulator_clip", iclip_def) minetest.register_node(":technic:insulator_clip_fencepost", iclipfence_def) -- MineClone2 support -local stone_ingrediant = nil -local white_dye_ingrediant = nil -local fence_ingrediant = nil if minetest.get_modpath("mcl_core") then - stone_ingrediant = "mcl_core:stone" - white_dye_ingrediant = "mcl_dye:white" - fence_ingrediant = "group:fence" + stone_ingredient = "mcl_core:stone" + white_dye_ingredient = "mcl_dye:white" + fence_ingredient = "group:fence" else - stone_ingrediant = "default:stone" - white_dye_ingrediant = "dye:white" - fence_ingrediant = "default:fence_wood" + stone_ingredient = "default:stone" + white_dye_ingredient = "dye:white" + fence_ingredient = "default:fence_wood" end minetest.register_craft({ output = "technic:insulator_clip", recipe = { - { "", white_dye_ingrediant, ""}, + { "", white_dye_ingredient, ""}, { "", "technic:raw_latex", ""}, - { "technic:raw_latex", stone_ingrediant, "technic:raw_latex"}, + { "technic:raw_latex", stone_ingredient, "technic:raw_latex"}, } }) minetest.register_craft({ output = "technic:insulator_clip_fencepost 2", recipe = { - { "", white_dye_ingrediant, ""}, + { "", white_dye_ingredient, ""}, { "", "technic:raw_latex", ""}, - { "technic:raw_latex", wood_fence_ingrediant, "technic:raw_latex"}, + { "technic:raw_latex", wood_fence_ingredient, "technic:raw_latex"}, } }) diff --git a/extranodes/mod.conf b/extranodes/mod.conf index 5080158..5963baf 100644 --- a/extranodes/mod.conf +++ b/extranodes/mod.conf @@ -1,4 +1,4 @@ name = extranodes depends = technic_worldgen, basic_materials, concrete optional_depends = unifieddyes, intllib, moreblocks, steel, streetsmod, default, mcl_core, mcl_sounds -supported_games = minetest_game,mineclone2 \ No newline at end of file +supported_games = minetest_game,mineclone2,mineclonia,mineclone5 \ No newline at end of file diff --git a/refactor.py b/refactor.py new file mode 100644 index 0000000..ba43106 --- /dev/null +++ b/refactor.py @@ -0,0 +1,40 @@ +import os +import re + +# Define the directory path of the project here +# For this example, I'm just using a placeholder path +# You would replace this with the path to your project directory +project_directory = './technic' + +# Regex to find all lines with either _ingredient or _sounds variables +variable_regex = re.compile(r'(\w+)(_ingredient|_sounds) = (.*)') + +# Function to refactor a single file +def refactor_file(file_path): + changes_made = False + with open(file_path, 'r') as file: + lines = file.readlines() + + with open(file_path, 'w') as file: + for line in lines: + match = variable_regex.search(line) + if match: + variable_name = match.group(1) + match.group(2) + new_line = f'technic.compat.{variable_name} = {match.group(3)}\n' + file.write(new_line) + changes_made = True + else: + file.write(line) + return changes_made + +# Function to walk through the project directory and refactor all files +def refactor_project(directory): + for subdir, _, files in os.walk(directory): + for file in files: + file_path = os.path.join(subdir, file) + if file_path.endswith('.lua'): + if refactor_file(file_path): + print(f'Refactored {file_path}') + +# Run the refactoring on the project directory +refactor_project(project_directory) diff --git a/technic/crafts.lua b/technic/crafts.lua index e7e7234..eb75b41 100644 --- a/technic/crafts.lua +++ b/technic/crafts.lua @@ -38,9 +38,9 @@ if pipeworks.enable_teleport_tube then minetest.register_craft({ output = 'pipeworks:teleport_tube_1', recipe = { - {mese_crystal_ingrediant, 'technic:copper_coil', mese_crystal_ingrediant}, + {mese_crystal_ingredient, 'technic:copper_coil', mese_crystal_ingredient}, {'pipeworks:tube_1', 'technic:control_logic_unit', 'pipeworks:tube_1'}, - {mese_crystal_ingrediant, 'technic:copper_coil', mese_crystal_ingrediant}, + {mese_crystal_ingredient, 'technic:copper_coil', mese_crystal_ingredient}, } }) end @@ -62,36 +62,36 @@ minetest.register_craft( { minetest.register_craft({ output = 'technic:diamond_drill_head', recipe = { - {'technic:stainless_steel_ingot', diamond_ingrediant, 'technic:stainless_steel_ingot'}, - {diamond_ingrediant, '', diamond_ingrediant}, - {'technic:stainless_steel_ingot', diamond_ingrediant, 'technic:stainless_steel_ingot'}, + {'technic:stainless_steel_ingot', diamond_ingredient, 'technic:stainless_steel_ingot'}, + {diamond_ingredient, '', diamond_ingredient}, + {'technic:stainless_steel_ingot', diamond_ingredient, 'technic:stainless_steel_ingot'}, } }) minetest.register_craft({ output = 'technic:green_energy_crystal', recipe = { - {gold_ingot_ingrediant, 'technic:battery', green_dye_ingrediant}, + {gold_ingot_ingredient, 'technic:battery', green_dye_ingredient}, {'technic:battery', 'technic:red_energy_crystal', 'technic:battery'}, - {green_dye_ingrediant, 'technic:battery', gold_ingot_ingrediant}, + {green_dye_ingredient, 'technic:battery', gold_ingot_ingredient}, } }) minetest.register_craft({ output = 'technic:blue_energy_crystal', recipe = { - {'moreores:mithril_ingot', 'technic:battery', blue_dye_ingrediant}, + {'moreores:mithril_ingot', 'technic:battery', blue_dye_ingredient}, {'technic:battery', 'technic:green_energy_crystal', 'technic:battery'}, - {blue_dye_ingrediant, 'technic:battery', 'moreores:mithril_ingot'}, + {blue_dye_ingredient, 'technic:battery', 'moreores:mithril_ingot'}, } }) minetest.register_craft({ output = 'technic:red_energy_crystal', recipe = { - {'moreores:silver_ingot', 'technic:battery', red_dye_ingrediant}, + {'moreores:silver_ingot', 'technic:battery', red_dye_ingredient}, {'technic:battery', 'basic_materials:energy_crystal_simple', 'technic:battery'}, - {red_dye_ingrediant, 'technic:battery', 'moreores:silver_ingot'}, + {red_dye_ingredient, 'technic:battery', 'moreores:silver_ingot'}, } }) @@ -143,7 +143,7 @@ minetest.register_craft({ output = 'technic:control_logic_unit', recipe = { {'', 'basic_materials:gold_wire', ''}, - {copper_ingrediant, 'technic:silicon_wafer', copper_ingrediant}, + {copper_ingredient, 'technic:silicon_wafer', copper_ingredient}, {'', 'technic:chromium_ingot', ''}, }, replacements = { {"basic_materials:gold_wire", "basic_materials:empty_spool"}, }, @@ -153,8 +153,8 @@ minetest.register_craft({ output = 'technic:mixed_metal_ingot 9', recipe = { {'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'}, - {bronze_ingrediant, bronze_ingrediant, bronze_ingrediant}, - {tin_ingrediant, tin_ingrediant, tin_ingrediant}, + {bronze_ingredient, bronze_ingredient, bronze_ingredient}, + {tin_ingredient, tin_ingredient, tin_ingredient}, } }) @@ -175,7 +175,7 @@ minetest.register_craft({ }) minetest.register_craft({ - output = dirt_ingrediant.." 2", + output = dirt_ingredient.." 2", type = "shapeless", replacements = {{"bucket:bucket_water","bucket:bucket_empty"}}, recipe = { @@ -191,14 +191,14 @@ minetest.register_craft({ type = "shapeless", recipe = { "technic:raw_latex", - coal_ingrediant, - coal_ingrediant, - coal_ingrediant, - coal_ingrediant, - coal_ingrediant, - coal_ingrediant, - coal_ingrediant, - coal_ingrediant, + coal_ingredient, + coal_ingredient, + coal_ingredient, + coal_ingredient, + coal_ingredient, + coal_ingredient, + coal_ingredient, + coal_ingredient, }, }) diff --git a/technic/init.lua b/technic/init.lua index 816a15a..3f469bc 100644 --- a/technic/init.lua +++ b/technic/init.lua @@ -40,6 +40,11 @@ else end local S = technic.getter +-- Check if mcl_core or default is installed +if not minetest.get_modpath("mcl_core") and not minetest.get_modpath("default") then + error(S(minetest.get_current_modname()).." "..S("requires mcl_core or default to be installed (please install MTG or MCL2, or compatible games)")) +end + -- Read configuration file dofile(modpath.."/config.lua") diff --git a/technic/machines/HV/forcefield.lua b/technic/machines/HV/forcefield.lua index ea28fcd..792aba6 100644 --- a/technic/machines/HV/forcefield.lua +++ b/technic/machines/HV/forcefield.lua @@ -17,9 +17,9 @@ local cable_entry = "^technic_cable_connection_overlay.png" minetest.register_craft({ output = "technic:forcefield_emitter_off", recipe = { - {mese_block_ingrediant, "basic_materials:motor", mese_block_ingrediant }, + {mese_block_ingredient, "basic_materials:motor", mese_block_ingredient}, {"technic:deployer_off", "technic:machine_casing", "technic:deployer_off"}, - {mese_block_ingrediant, "technic:hv_cable", mese_block_ingrediant }, + {mese_block_ingredient, "technic:hv_cable", mese_block_ingredient}, } }) diff --git a/technic/machines/HV/nuclear_reactor.lua b/technic/machines/HV/nuclear_reactor.lua index 3978d3e..43c6bf6 100644 --- a/technic/machines/HV/nuclear_reactor.lua +++ b/technic/machines/HV/nuclear_reactor.lua @@ -24,7 +24,7 @@ local cable_entry = "^technic_cable_connection_overlay.png" minetest.register_craft({ output = 'technic:hv_nuclear_reactor_core', recipe = { - {'technic:carbon_plate', obsidian_glass_ingrediant, 'technic:carbon_plate'}, + {'technic:carbon_plate', obsidian_glass_ingredient, 'technic:carbon_plate'}, {'technic:composite_plate', 'technic:machine_casing', 'technic:composite_plate'}, {'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'}, } diff --git a/technic/machines/HV/quarry.lua b/technic/machines/HV/quarry.lua index 28d273b..c1d3c2d 100644 --- a/technic/machines/HV/quarry.lua +++ b/technic/machines/HV/quarry.lua @@ -229,7 +229,6 @@ local function send_move_error(player) return 0 end -local quarry_pick = nil if minetest.get_modpath("mcl_core") then quarry_pick = "default_tool_diamondpick.png" else diff --git a/technic/machines/LV/alloy_furnace.lua b/technic/machines/LV/alloy_furnace.lua index 773d41c..db35d73 100644 --- a/technic/machines/LV/alloy_furnace.lua +++ b/technic/machines/LV/alloy_furnace.lua @@ -4,9 +4,9 @@ minetest.register_craft({ output = 'technic:lv_alloy_furnace', recipe = { - {brick_block_ingrediant, brick_block_ingrediant, brick_block_ingrediant}, - {brick_block_ingrediant, 'technic:machine_casing', brick_block_ingrediant}, - {brick_block_ingrediant, 'technic:lv_cable', brick_block_ingrediant}, + {brick_block_ingredient, brick_block_ingredient, brick_block_ingredient}, + {brick_block_ingredient, 'technic:machine_casing', brick_block_ingredient}, + {brick_block_ingredient, 'technic:lv_cable', brick_block_ingredient}, } }) diff --git a/technic/machines/LV/cables.lua b/technic/machines/LV/cables.lua index b9c4584..cb12032 100644 --- a/technic/machines/LV/cables.lua +++ b/technic/machines/LV/cables.lua @@ -4,9 +4,9 @@ minetest.register_alias("lv_cable", "technic:lv_cable") minetest.register_craft({ output = 'technic:lv_cable 6', recipe = { - {paper_ingrediant, paper_ingrediant, paper_ingrediant}, - {copper_ingrediant, copper_ingrediant, copper_ingrediant}, - {paper_ingrediant, paper_ingrediant, paper_ingrediant}, + {paper_ingredient, paper_ingredient, paper_ingredient}, + {copper_ingredient, copper_ingredient, copper_ingredient}, + {paper_ingredient, paper_ingredient, paper_ingredient}, } }) diff --git a/technic/machines/LV/compressor.lua b/technic/machines/LV/compressor.lua index be26365..d300cbc 100644 --- a/technic/machines/LV/compressor.lua +++ b/technic/machines/LV/compressor.lua @@ -4,7 +4,7 @@ minetest.register_alias("compressor", "technic:lv_compressor") minetest.register_craft({ output = 'technic:lv_compressor', recipe = { - {stone_ingrediant, 'basic_materials:motor', stone_ingrediant}, + {stone_ingredient, 'basic_materials:motor', stone_ingredient}, {'mesecons:piston', 'technic:machine_casing', 'mesecons:piston'}, {'basic_materials:silver_wire', 'technic:lv_cable', 'basic_materials:silver_wire'}, }, diff --git a/technic/machines/LV/electric_furnace.lua b/technic/machines/LV/electric_furnace.lua index 61dc9cc..53f3a58 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 = { - {cobble_ingrediant, cobble_ingrediant, cobble_ingrediant}, - {cobble_ingrediant, 'technic:machine_casing', cobble_ingrediant}, - {cobble_ingrediant, 'technic:lv_cable', cobble_ingrediant}, + {cobble_ingredient, cobble_ingredient, cobble_ingredient}, + {cobble_ingredient, 'technic:machine_casing', cobble_ingredient}, + {cobble_ingredient, 'technic:lv_cable', cobble_ingredient}, } }) diff --git a/technic/machines/LV/generator.lua b/technic/machines/LV/generator.lua index 20fcaac..5ff9e9f 100644 --- a/technic/machines/LV/generator.lua +++ b/technic/machines/LV/generator.lua @@ -8,9 +8,9 @@ minetest.register_alias("lv_generator", "technic:lv_generator") minetest.register_craft({ output = 'technic:lv_generator', recipe = { - {stone_ingrediant, furnace_ingrediant, stone_ingrediant}, - {stone_ingrediant, 'technic:machine_casing', stone_ingrediant}, - {stone_ingrediant, 'technic:lv_cable', stone_ingrediant}, + {stone_ingredient, furnace_ingredient, stone_ingredient}, + {stone_ingredient, 'technic:machine_casing', stone_ingredient}, + {stone_ingredient, 'technic:lv_cable', stone_ingredient}, } }) diff --git a/technic/machines/LV/geothermal.lua b/technic/machines/LV/geothermal.lua index 616cc9e..48aadd6 100644 --- a/technic/machines/LV/geothermal.lua +++ b/technic/machines/LV/geothermal.lua @@ -10,9 +10,9 @@ local S = technic.getter minetest.register_craft({ output = 'technic:geothermal', recipe = { - {granite_ingrediant, diamond_ingrediant, granite_ingrediant}, + {granite_ingredient, diamond_ingredient, granite_ingredient}, {'basic_materials:copper_wire', 'technic:machine_casing', 'basic_materials:copper_wire'}, - {granite_ingrediant, 'technic:lv_cable', granite_ingrediant}, + {granite_ingredient, 'technic:lv_cable', granite_ingredient}, }, replacements = { {"basic_materials:copper_wire", "basic_materials:empty_spool"}, diff --git a/technic/machines/LV/grinder.lua b/technic/machines/LV/grinder.lua index 9fd21fc..d6354fe 100644 --- a/technic/machines/LV/grinder.lua +++ b/technic/machines/LV/grinder.lua @@ -3,9 +3,9 @@ minetest.register_alias("grinder", "technic:lv_grinder") minetest.register_craft({ output = 'technic:lv_grinder', recipe = { - {desert_stone_ingrediant, diamond_ingrediant, desert_stone_ingrediant}, - {desert_stone_ingrediant, 'technic:machine_casing', desert_stone_ingrediant}, - {granite_ingrediant, 'technic:lv_cable', granite_ingrediant}, + {desert_stone_ingredient, diamond_ingredient, desert_stone_ingredient}, + {desert_stone_ingredient, 'technic:machine_casing', desert_stone_ingredient}, + {granite_ingredient, 'technic:lv_cable', granite_ingredient}, } }) diff --git a/technic/machines/LV/lamp.lua b/technic/machines/LV/lamp.lua index 72683d1..6d580bb 100644 --- a/technic/machines/LV/lamp.lua +++ b/technic/machines/LV/lamp.lua @@ -149,7 +149,7 @@ technic.register_machine("LV", "technic:lv_lamp_active", technic.receiver) minetest.register_craft({ output = "technic:lv_lamp", recipe = { - {glass_ingrediant, glass_ingrediant, glass_ingrediant}, + {glass_ingredient, glass_ingredient, glass_ingredient}, {"technic:lv_led", "technic:lv_led", "technic:lv_led"}, {"mesecons_materials:glue", "technic:lv_cable", "mesecons_materials:glue"}, } diff --git a/technic/machines/LV/music_player.lua b/technic/machines/LV/music_player.lua index f47d6b8..272b5a8 100644 --- a/technic/machines/LV/music_player.lua +++ b/technic/machines/LV/music_player.lua @@ -7,9 +7,9 @@ minetest.register_alias("music_player", "technic:music_player") minetest.register_craft({ output = 'technic:music_player', recipe = { - {'technic:chromium_ingot', diamond_ingrediant, 'technic:chromium_ingot'}, - {diamond_ingrediant, 'technic:machine_casing', diamond_ingrediant}, - {mossy_cobble_ingrediant, 'technic:lv_cable', mossy_cobble_ingrediant}, + {'technic:chromium_ingot', diamond_ingredient, 'technic:chromium_ingot'}, + {diamond_ingredient, 'technic:machine_casing', diamond_ingredient}, + {mossy_cobble_ingredient, 'technic:lv_cable', mossy_cobble_ingredient}, } }) diff --git a/technic/machines/LV/water_mill.lua b/technic/machines/LV/water_mill.lua index a397737..2fa8161 100644 --- a/technic/machines/LV/water_mill.lua +++ b/technic/machines/LV/water_mill.lua @@ -11,7 +11,7 @@ minetest.register_alias("water_mill", "technic:water_mill") minetest.register_craft({ output = 'technic:water_mill', recipe = { - {'technic:marble', diamond_ingrediant, 'technic:marble'}, + {'technic:marble', diamond_ingredient, 'technic:marble'}, {'group:wood', 'technic:machine_casing', 'group:wood'}, {'technic:marble', 'technic:lv_cable', 'technic:marble'}, } diff --git a/technic/machines/MV/tool_workshop.lua b/technic/machines/MV/tool_workshop.lua index eee566f..82973c0 100644 --- a/technic/machines/MV/tool_workshop.lua +++ b/technic/machines/MV/tool_workshop.lua @@ -10,9 +10,9 @@ local tube_entry = "^pipeworks_tube_connection_wooden.png" minetest.register_craft({ output = 'technic:tool_workshop', recipe = { - {'group:wood', diamond_ingrediant, 'group:wood'}, + {'group:wood', diamond_ingredient, 'group:wood'}, {'mesecons_pistons:piston_sticky_off', 'technic:machine_casing', 'technic:carbon_cloth'}, - {obsidian_ingrediant, 'technic:mv_cable', obsidian_ingrediant}, + {obsidian_ingredient, 'technic:mv_cable', obsidian_ingredient}, } }) diff --git a/technic/machines/other/coal_alloy_furnace.lua b/technic/machines/other/coal_alloy_furnace.lua index 0197b67..d4584e0 100644 --- a/technic/machines/other/coal_alloy_furnace.lua +++ b/technic/machines/other/coal_alloy_furnace.lua @@ -6,9 +6,9 @@ local S = technic.getter minetest.register_craft({ output = 'technic:coal_alloy_furnace', recipe = { - {brick_block_ingrediant, brick_block_ingrediant, brick_block_ingrediant}, - {brick_block_ingrediant, '', brick_block_ingrediant}, - {brick_block_ingrediant, brick_block_ingrediant, brick_block_ingrediant}, + {brick_block_ingredient, brick_block_ingredient, brick_block_ingredient}, + {brick_block_ingredient, '', brick_block_ingredient}, + {brick_block_ingredient, brick_block_ingredient, brick_block_ingredient}, } }) diff --git a/technic/machines/other/frames.lua b/technic/machines/other/frames.lua index 8120f4c..923adff 100644 --- a/technic/machines/other/frames.lua +++ b/technic/machines/other/frames.lua @@ -981,7 +981,7 @@ minetest.register_craft({ output = 'technic:template 10', recipe = { { '', 'basic_materials:brass_ingot', '' }, - { 'basic_materials:brass_ingot', mese_crystal_ingrediant, 'basic_materials:brass_ingot' }, + { 'basic_materials:brass_ingot', mese_crystal_ingredient, 'basic_materials:brass_ingot' }, { '', 'basic_materials:brass_ingot', '' }, } }) @@ -1009,7 +1009,7 @@ minetest.register_craft({ output = 'technic:template_tool', recipe = { { '', 'technic:template', '' }, - { mese_crystal_ingrediant, 'default:stick', mese_crystal_ingrediant }, + { mese_crystal_ingredient, 'default:stick', mese_crystal_ingredient }, { '', 'default:stick', '' }, } }) diff --git a/technic/machines/other/injector.lua b/technic/machines/other/injector.lua index 307a38d..8bc6a56 100644 --- a/technic/machines/other/injector.lua +++ b/technic/machines/other/injector.lua @@ -47,7 +47,7 @@ minetest.register_craft({ output = 'technic:injector 1', recipe = { {'', 'technic:control_logic_unit',''}, - {'', chest_ingrediant,''}, + {'', chest_ingredient,''}, {'', 'pipeworks:tube_1',''}, } }) diff --git a/technic/machines/power_monitor.lua b/technic/machines/power_monitor.lua index 80e8ce2..14e9863 100644 --- a/technic/machines/power_monitor.lua +++ b/technic/machines/power_monitor.lua @@ -10,7 +10,7 @@ minetest.register_craft({ output = "technic:power_monitor", recipe = { {"", "", ""}, - {"", "technic:machine_casing", copper_ingrediant}, + {"", "technic:machine_casing", copper_ingredient}, {"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"} } }) diff --git a/technic/machines/register/battery_box.lua b/technic/machines/register/battery_box.lua index c96df6a..b271550 100644 --- a/technic/machines/register/battery_box.lua +++ b/technic/machines/register/battery_box.lua @@ -17,9 +17,9 @@ technic.register_power_tool("technic:blue_energy_crystal", 450000) minetest.register_craft({ output = "technic:battery", recipe = { - {"group:wood", copper_ingrediant, "group:wood"}, + {"group:wood", copper_ingredient, "group:wood"}, {"group:wood", "default:tin_ingot", "group:wood"}, - {"group:wood", copper_ingrediant, "group:wood"}, + {"group:wood", copper_ingredient, "group:wood"}, } }) -- Sulfur-lead-water recipes: diff --git a/technic/machines/register/common.lua b/technic/machines/register/common.lua index 7dcb7c9..389996e 100644 --- a/technic/machines/register/common.lua +++ b/technic/machines/register/common.lua @@ -35,7 +35,7 @@ end -- handles the machine upgrades when set or removed local function on_machine_upgrade(meta, stack) local stack_name = stack:get_name() - if stack_name == chest_ingrediant then + if stack_name == chest_ingredient then meta:set_int("public", 1) return 1 elseif stack_name ~= "technic:control_logic_unit" @@ -47,7 +47,7 @@ end -- something is about to be removed local function on_machine_downgrade(meta, stack, list) - if stack:get_name() == chest_ingrediant then + if stack:get_name() == chest_ingredient then local inv = meta:get_inventory() local upg1, upg2 = inv:get_stack("upgrade1", 1), inv:get_stack("upgrade2", 1) diff --git a/technic/machines/register/extractor_recipes.lua b/technic/machines/register/extractor_recipes.lua index cc95153..090260b 100644 --- a/technic/machines/register/extractor_recipes.lua +++ b/technic/machines/register/extractor_recipes.lua @@ -11,7 +11,7 @@ end if minetest.get_modpath("dye") or minetest.get_modpath("mcl_dye") then -- check if we are using dye or unifieddyes local unifieddyes = minetest.get_modpath("unifieddyes") - + for _, data in ipairs(extractor_recipes) do technic.register_extractor_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 a99ca37..28a1c4a 100644 --- a/technic/machines/register/grinder_recipes.lua +++ b/technic/machines/register/grinder_recipes.lua @@ -82,15 +82,15 @@ 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", copper_ingrediant) +register_dust("Copper", copper_ingredient) register_dust("Lead", "technic:lead_ingot") -register_dust("Gold", gold_ingot_ingrediant) +register_dust("Gold", gold_ingot_ingredient) 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", tin_ingrediant) +register_dust("Tin", tin_ingredient) 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 diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua index e9964a3..ef1c01b 100644 --- a/technic/machines/switching_station.lua +++ b/technic/machines/switching_station.lua @@ -15,7 +15,7 @@ minetest.register_craft({ output = "technic:switching_station", recipe = { {"", "technic:lv_transformer", ""}, - {copper_ingrediant, "technic:machine_casing", copper_ingrediant}, + {copper_ingredient, "technic:machine_casing", copper_ingredient}, {"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"} } }) diff --git a/technic/mcl_craftguide.lua b/technic/mcl_craftguide.lua index ffa162e..b652908 100644 --- a/technic/mcl_craftguide.lua +++ b/technic/mcl_craftguide.lua @@ -6,12 +6,12 @@ mcl_craftguide.register_craft_type("centrifuge", { mcl_craftguide.register_craft_type("compressor", { description = "Compressor", - icon = "technic_lv_compressor_front_active.png", + icon = "technic_lv_compressor_front_active.png", }) mcl_craftguide.register_craft_type("extractor", { description = "Extractor", - icon = "technic_lv_extractor_front_active.png", + icon = "technic_lv_extractor_front_active.png", }) mcl_craftguide.register_craft_type("freezer", { @@ -21,7 +21,7 @@ mcl_craftguide.register_craft_type("freezer", { mcl_craftguide.register_craft_type("grinder", { description = "Grinder", - icon = "technic_lv_grinder_front_active.png", + icon = "technic_lv_grinder_front_active.png", }) mcl_craftguide.register_craft_type("alloy_furnace", { @@ -34,17 +34,17 @@ centrifuge_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", sand_ingrediant, "technic:uranium3_dust" }, - { dirt_ingrediant.." 4", sand_ingrediant, gravel_ingrediant, "default:clay_lump 2" }, + { "technic:chernobylite_dust", sand_ingredient, "technic:uranium3_dust" }, + { dirt_ingredient.." 4", sand_ingredient, gravel_ingredient, "default:clay_lump 2" }, } compressor_recipes = { - {snow_block_ingrediant, ice_block_ingrediant}, - {sand_ingrediant.." 2", sandstone_ingrediant}, - {desert_sand_ingrediant.." 2", desert_stone_ingrediant}, - {desert_sand_ingrediant, desert_stone_ingrediant}, + {snow_block_ingredient, ice_block_ingredient}, + {sand_ingredient.." 2", sandstone_ingredient}, + {desert_sand_ingredient.." 2", desert_stone_ingredient}, + {desert_sand_ingredient, desert_stone_ingredient}, {"technic:mixed_metal_ingot", "technic:composite_plate"}, - {copper_ingrediant.." 5", "technic:copper_plate"}, + {copper_ingredient.." 5", "technic:copper_plate"}, {"technic:coal_dust 4", "technic:graphite"}, {"technic:carbon_cloth", "technic:carbon_plate"}, {"technic:uranium35_ingot 5", "technic:uranium_fuel"}, @@ -68,40 +68,40 @@ extractor_recipes = { } freezer_recipes = { - {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 } } + {water_bucket_ingredient, { ice_block_ingredient, emtpy_bucket_ingredient } }, + {bucket_river_water_ingredient, { ice_block_ingredient, emtpy_bucket_ingredient } }, + {dirt_ingredient , dirt_with_snow_ingredient }, + {bucket_lava_ingredient, { obsidian_ingredient, emtpy_bucket_ingredient } } } grinder_recipes = { -- 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"}, + {coal_ingredient, "technic:coal_dust 2"}, + {copper_lump_ingredient, "technic:copper_dust 2"}, + {desert_stone_ingredient, desert_sand_ingredient}, + {gold_lump_ingredient, "technic:gold_dust 2"}, + {iron_lump_ingredient, "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"}, + {stone_ingredient, "technic:stone_dust"}, + {sand_ingredient, "technic:stone_dust"}, + {desert_sand_ingredient, "technic:stone_dust"}, -- 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}, + {cobble_ingredient, gravel_ingredient}, + {gravel_ingredient, sand_ingredient}, + {sandstone_ingredient, sand_ingredient.." 2"}, -- reverse recipe can be found in the compressor + {desert_stone_ingredient, desert_sand_ingredient.." 2"}, -- reverse recipe can be found in the compressor + {ice_block_ingredient, snow_block_ingredient}, } alloy_recipes = { {"technic:copper_dust 7", "technic:tin_dust", "technic:bronze_dust 8", 12}, - {copper_ingrediant.." 7", tin_ingrediant, bronze_ingrediant.." 8", 12}, + {copper_ingredient.." 7", tin_ingredient, bronze_ingredient.." 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}, @@ -109,14 +109,14 @@ alloy_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"}, - {sand_ingrediant.." 2", "technic:coal_dust 2", "technic:silicon_wafer"}, + {copper_ingredient.." 2", "technic:zinc_ingot", "basic_materials:brass_ingot 3"}, + {sand_ingredient.." 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}, - {ice_block_ingrediant, emtpy_bucket_ingrediant, water_bucket_ingrediant, 1 }, + {ice_block_ingredient, emtpy_bucket_ingredient, water_bucket_ingredient, 1 }, } for _, data in pairs(alloy_recipes) do diff --git a/technic/mcl_support.lua b/technic/mcl_support.lua index 2c1d36e..cd1638e 100644 --- a/technic/mcl_support.lua +++ b/technic/mcl_support.lua @@ -1,51 +1,60 @@ local default = minetest.get_modpath("default") and default or {} -local mcl_core_modpath = minetest.get_modpath("mcl_core") +local mcl = minetest.get_modpath("mcl_core") + +-- Compatibility table +local technic = {} +technic.compat = {} + +-- Helper function to set compatibility variables +local function set_compat(mcl_value, default_value) + return mcl and mcl_value or default_value +end -- Mineclone2 Support stone_sounds = mcl_core_modpath and mcl_sounds.node_sound_stone_defaults() or default.node_sound_stone_defaults() mt_light_max = mcl_core_modpath and mcl_core.LIGHT_MAX or default.LIGHT_MAX -copper_ingrediant = mcl_core_modpath and "mcl_copper:copper_ingot" or 'default:copper_ingot' -iron_ingrediant = mcl_core_modpath and "mcl_core:iron_ingot" or 'default:steel_ingot' -iron_lump_ingrediant = mcl_core_modpath and "mcl_raw_ores:raw_iron" or 'default:iron_lump' -gold_lump_ingrediant = mcl_core_modpath and "mcl_raw_ores:raw_gold" or 'default:gold_lump' -copper_lump_ingrediant = mcl_core_modpath and "mcl_copper:raw_copper" or 'default:copper_lump' -mese_crystal_ingrediant = mcl_core_modpath and "mesecons:wire_00000000_off" or 'default:mese_crystal' -diamond_ingrediant = mcl_core_modpath and "mcl_core:diamond" or 'default:diamond' -glass_ingrediant = mcl_core_modpath and "mcl_core:glass" or 'default:glass' -brick_block_ingrediant = mcl_core_modpath and "mcl_core:brick_block" or 'default:brick' -mese_block_ingrediant = mcl_core_modpath and "mesecons_torch:redstoneblock" or "default:mese" -paper_ingrediant = mcl_core_modpath and "mcl_core:paper" or 'default:paper' -obsidian_glass_ingrediant = mcl_core_modpath and "mcl_core:obsidian" or 'default:obsidian_glass' -obsidian_ingrediant = mcl_core_modpath and "mcl_core:obsidian" or 'default:obsidian' -green_dye_ingrediant = mcl_core_modpath and "mcl_dye:green" or 'dye:green' -blue_dye_ingrediant = mcl_core_modpath and "mcl_dye:blue" or 'dye:blue' -red_dye_ingrediant = mcl_core_modpath and "mcl_dye:red" or 'dye:red' -white_dye_ingrediant = mcl_core_modpath and "mcl_dye:white" or 'dye:white' -gold_ingot_ingrediant = mcl_core_modpath and "mcl_core:gold_ingot" or 'default:gold_ingot' -chest_ingrediant = mcl_core_modpath and "mcl_chests:chest" or "default:chest" -stone_ingrediant = mcl_core_modpath and "mcl_core:stone" or "default:stone" -wood_fence_ingrediant = mcl_core_modpath and "group:fence_wood" or "default:fence_wood" -diamond_ingrediant = mcl_core_modpath and "mcl_core:diamond" or "default:diamond" -bronze_ingrediant = mcl_core_modpath and "mcl_copper:copper_ingot" or 'default:bronze_ingot' -tin_ingrediant = mcl_core_modpath and "moreores:tin_ingot" or 'default:tin_ingot' -sandstone_ingrediant = mcl_core_modpath and "mcl_core:sandstone" or 'default:desert_stone' -sand_ingrediant = mcl_core_modpath and "mcl_core:sand" or 'default:sand' -gravel_ingrediant = mcl_core_modpath and "mcl_core:gravel" or 'default:gravel' -desert_stone_ingrediant = mcl_core_modpath and "mcl_core:redsandstone" or 'default:desert_stone' -desert_sand_ingrediant = mcl_core_modpath and "mcl_core:redsand" or 'default:desert_sand' -furnace_ingrediant = mcl_core_modpath and "mcl_furnaces:furnace" or 'default:furnace' -mossy_cobble_ingrediant = mcl_core_modpath and "mcl_core:mossycobble" or 'default:mossycobble' -cobble_ingrediant = mcl_core_modpath and "mcl_core:cobble" or 'default:cobble' -snow_block_ingrediant = mcl_core_modpath and "mcl_core:snowblock" or 'default:snowblock' -ice_block_ingrediant = mcl_core_modpath and "mcl_core:ice" or 'default:ice' -granite_ingrediant = mcl_core_modpath and "mcl_core:granite" or 'technic:granite' -granite_bricks_ingrediant = mcl_core_modpath and "mcl_core:granite_smooth" or 'technic:granite_bricks' -coal_ingrediant = mcl_core_modpath and "group:coal" or "default:coal_lump" -dirt_ingrediant = mcl_core_modpath and "mcl_core:dirt" or "default:dirt" -mesecons_fiber_ingrediant = mcl_core_modpath and "mesecons:wire_00000000_off" or "mesecons_materials:fiber" -stick_ingrediant = mcl_core_modpath and "mcl_core:stick" or "default:stick" -emtpy_bucket_ingrediant = mcl_core_modpath and "mcl_buckets:bucket_empty" or "bucket:bucket_empty" -water_bucket_ingrediant = mcl_core_modpath and "mcl_buckets:bucket_water" or "bucket:bucket_water" +copper_ingredient = mcl_core_modpath and "mcl_copper:copper_ingot" or 'default:copper_ingot' +iron_ingredient = mcl_core_modpath and "mcl_core:iron_ingot" or 'default:steel_ingot' +iron_lump_ingredient = mcl_core_modpath and "mcl_raw_ores:raw_iron" or 'default:iron_lump' +gold_lump_ingredient = mcl_core_modpath and "mcl_raw_ores:raw_gold" or 'default:gold_lump' +copper_lump_ingredient = mcl_core_modpath and "mcl_copper:raw_copper" or 'default:copper_lump' +mese_crystal_ingredient = mcl_core_modpath and "mesecons:wire_00000000_off" or 'default:mese_crystal' +diamond_ingredient = mcl_core_modpath and "mcl_core:diamond" or 'default:diamond' +glass_ingredient = mcl_core_modpath and "mcl_core:glass" or 'default:glass' +brick_block_ingredient = mcl_core_modpath and "mcl_core:brick_block" or 'default:brick' +mese_block_ingredient = mcl_core_modpath and "mesecons_torch:redstoneblock" or "default:mese" +paper_ingredient = mcl_core_modpath and "mcl_core:paper" or 'default:paper' +obsidian_glass_ingredient = mcl_core_modpath and "mcl_core:obsidian" or 'default:obsidian_glass' +obsidian_ingredient = mcl_core_modpath and "mcl_core:obsidian" or 'default:obsidian' +green_dye_ingredient = mcl_core_modpath and "mcl_dye:green" or 'dye:green' +blue_dye_ingredient = mcl_core_modpath and "mcl_dye:blue" or 'dye:blue' +red_dye_ingredient = mcl_core_modpath and "mcl_dye:red" or 'dye:red' +white_dye_ingredient = mcl_core_modpath and "mcl_dye:white" or 'dye:white' +gold_ingot_ingredient = mcl_core_modpath and "mcl_core:gold_ingot" or 'default:gold_ingot' +chest_ingredient = mcl_core_modpath and "mcl_chests:chest" or "default:chest" +stone_ingredient = mcl_core_modpath and "mcl_core:stone" or "default:stone" +wood_fence_ingredient = mcl_core_modpath and "group:fence_wood" or "default:fence_wood" +diamond_ingredient = mcl_core_modpath and "mcl_core:diamond" or "default:diamond" +bronze_ingredient = mcl_core_modpath and "mcl_copper:copper_ingot" or 'default:bronze_ingot' +tin_ingredient = mcl_core_modpath and "moreores:tin_ingot" or 'default:tin_ingot' +sandstone_ingredient = mcl_core_modpath and "mcl_core:sandstone" or 'default:desert_stone' +sand_ingredient = mcl_core_modpath and "mcl_core:sand" or 'default:sand' +gravel_ingredient = mcl_core_modpath and "mcl_core:gravel" or 'default:gravel' +desert_stone_ingredient = mcl_core_modpath and "mcl_core:redsandstone" or 'default:desert_stone' +desert_sand_ingredient = mcl_core_modpath and "mcl_core:redsand" or 'default:desert_sand' +furnace_ingredient = mcl_core_modpath and "mcl_furnaces:furnace" or 'default:furnace' +mossy_cobble_ingredient = mcl_core_modpath and "mcl_core:mossycobble" or 'default:mossycobble' +cobble_ingredient = mcl_core_modpath and "mcl_core:cobble" or 'default:cobble' +snow_block_ingredient = mcl_core_modpath and "mcl_core:snowblock" or 'default:snowblock' +ice_block_ingredient = mcl_core_modpath and "mcl_core:ice" or 'default:ice' +granite_ingredient = mcl_core_modpath and "mcl_core:granite" or 'technic:granite' +granite_bricks_ingredient = mcl_core_modpath and "mcl_core:granite_smooth" or 'technic:granite_bricks' +coal_ingredient = mcl_core_modpath and "group:coal" or "default:coal_lump" +dirt_ingredient = mcl_core_modpath and "mcl_core:dirt" or "default:dirt" +mesecons_fiber_ingredient = mcl_core_modpath and "mesecons:wire_00000000_off" or "mesecons_materials:fiber" +stick_ingredient = mcl_core_modpath and "mcl_core:stick" or "default:stick" +emtpy_bucket_ingredient = mcl_core_modpath and "mcl_buckets:bucket_empty" or "bucket:bucket_empty" +water_bucket_ingredient = mcl_core_modpath and "mcl_buckets:bucket_water" or "bucket:bucket_water" -- Ingredient Variables if mcl_core_modpath then @@ -97,6 +106,6 @@ else dye_red = "dye:red" end -dirt_with_snow_ingrediant = mcl_core_modpath and "mcl_core:dirt_with_grass_snow" or "default:dirt_with_snow" -bucket_lava_ingrediant = mcl_core_modpath and "mcl_buckets:bucket_lava" or "bucket:bucket_lava" -bucket_river_water_ingrediant = mcl_core_modpath and "mcl_buckets:bucket_river_water" or "bucket:bucket_river_water" +dirt_with_snow_ingredient = mcl_core_modpath and "mcl_core:dirt_with_grass_snow" or "default:dirt_with_snow" +bucket_lava_ingredient = mcl_core_modpath and "mcl_buckets:bucket_lava" or "bucket:bucket_lava" +bucket_river_water_ingredient = mcl_core_modpath and "mcl_buckets:bucket_river_water" or "bucket:bucket_river_water" diff --git a/technic/mod.conf b/technic/mod.conf index 480451a..448cf74 100644 --- a/technic/mod.conf +++ b/technic/mod.conf @@ -1,4 +1,4 @@ name = technic depends = pipeworks, technic_worldgen, basic_materials optional_depends = bucket, default, screwdriver, mesecons,mesecons_torch, mesecons_mvps, digilines, digiline_remote, intllib, unified_inventory, vector_extras, dye, craftguide,i3, mcl_core, mcl_craftguide -supported_games = minetest_game,mineclone2 \ No newline at end of file +supported_games = minetest_game,mineclone2,mineclonia,mineclone5 \ No newline at end of file diff --git a/technic/radiation.lua b/technic/radiation.lua index 52554b2..d0cdb59 100644 --- a/technic/radiation.lua +++ b/technic/radiation.lua @@ -52,7 +52,7 @@ local rad_resistance_node = { ["default:ice"] = 5.6, ["default:lava_flowing"] = 8.5, ["default:lava_source"] = 17, - [mese_block_ingrediant] = 21, + [mese_block_ingredient] = 21, ["default:mossycobble"] = 15, ["default:tinblock"] = 37, ["pbj_pup:pbj_pup"] = 10000, @@ -64,7 +64,7 @@ local rad_resistance_node = { ["nyancat:nyancat"] = 10000, ["nyancat:nyancat_rainbow"] = 10000, ["default:obsidian"] = 18, - [obsidian_glass_ingrediant] = 18, + [obsidian_glass_ingredient] = 18, ["default:sand"] = 10, ["default:sandstone"] = 15, ["default:sandstonebrick"] = 15, @@ -153,7 +153,7 @@ local rad_resistance_node = { ["technic:chromium_block"] = 37, ["technic:corium_flowing"] = 40, ["technic:corium_source"] = 80, - [granite_ingrediant] = 18, + [granite_ingredient] = 18, ["technic:lead_block"] = 80, ["technic:marble"] = 18, ["technic:marble_bricks"] = 18, diff --git a/technic/tools/cans.lua b/technic/tools/cans.lua index 8853560..aa6b161 100644 --- a/technic/tools/cans.lua +++ b/technic/tools/cans.lua @@ -135,7 +135,7 @@ minetest.register_craft({ output = 'technic:river_water_can 1', recipe = { {'technic:zinc_ingot', 'technic:rubber', 'technic:zinc_ingot'}, - {iron_ingrediant, '', iron_ingrediant}, - {'technic:zinc_ingot', iron_ingrediant, 'technic:zinc_ingot'}, + {iron_ingredient, '', iron_ingredient}, + {'technic:zinc_ingot', iron_ingredient, 'technic:zinc_ingot'}, } }) diff --git a/technic/tools/mining_drill.lua b/technic/tools/mining_drill.lua index 4b1ad3f..fec7b93 100644 --- a/technic/tools/mining_drill.lua +++ b/technic/tools/mining_drill.lua @@ -6,9 +6,9 @@ local S = technic.getter minetest.register_craft({ output = 'technic:mining_drill', recipe = { - {tin_ingrediant, 'technic:diamond_drill_head', tin_ingrediant}, + {tin_ingredient, 'technic:diamond_drill_head', tin_ingredient}, {'technic:stainless_steel_ingot', 'basic_materials:motor', 'technic:stainless_steel_ingot'}, - {'', 'technic:red_energy_crystal', copper_ingrediant}, + {'', 'technic:red_energy_crystal', copper_ingredient}, } }) minetest.register_craft({ diff --git a/technic/tools/mining_lasers.lua b/technic/tools/mining_lasers.lua index 0f5d88b..f3db2c1 100644 --- a/technic/tools/mining_lasers.lua +++ b/technic/tools/mining_lasers.lua @@ -11,25 +11,25 @@ local S = technic.getter minetest.register_craft({ output = "technic:laser_mk1", recipe = { - {diamond_ingrediant, "basic_materials:brass_ingot", obsidian_glass_ingrediant}, - {"", "basic_materials:brass_ingot", "technic:red_energy_crystal"}, - {"", "", copper_ingrediant}, + {diamond_ingredient, "basic_materials:brass_ingot", obsidian_glass_ingredient}, + {"","basic_materials:brass_ingot", "technic:red_energy_crystal"}, + {"", "", copper_ingredient}, } }) minetest.register_craft({ output = "technic:laser_mk2", recipe = { - {diamond_ingrediant, "technic:carbon_steel_ingot", "technic:laser_mk1"}, - {"", "technic:carbon_steel_ingot", "technic:green_energy_crystal"}, - {"", "", copper_ingrediant}, + {diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk1"}, + {"", "technic:carbon_steel_ingot", "technic:green_energy_crystal"}, + {"", "", copper_ingredient}, } }) minetest.register_craft({ output = "technic:laser_mk3", recipe = { - {diamond_ingrediant, "technic:carbon_steel_ingot", "technic:laser_mk2"}, - {"", "technic:carbon_steel_ingot", "technic:blue_energy_crystal"}, - {"", "", copper_ingrediant}, + {diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk2"}, + {"", "technic:carbon_steel_ingot", "technic:blue_energy_crystal"}, + {"", "", copper_ingredient}, } }) diff --git a/technic/tools/sonic_screwdriver.lua b/technic/tools/sonic_screwdriver.lua index 0cbe511..2044e5b 100644 --- a/technic/tools/sonic_screwdriver.lua +++ b/technic/tools/sonic_screwdriver.lua @@ -90,9 +90,9 @@ minetest.register_tool("technic:sonic_screwdriver", { minetest.register_craft({ output = "technic:sonic_screwdriver", recipe = { - {"", diamond_ingrediant, ""}, - {mesecons_fiber_ingrediant, "technic:battery", mesecons_fiber_ingrediant}, - {mesecons_fiber_ingrediant, "moreores:mithril_ingot", mesecons_fiber_ingrediant} + {"", diamond_ingredient, ""}, + {mesecons_fiber_ingredient, "technic:battery", mesecons_fiber_ingredient}, + {mesecons_fiber_ingredient, "moreores:mithril_ingot", mesecons_fiber_ingredient} } }) diff --git a/technic/tools/tree_tap.lua b/technic/tools/tree_tap.lua index 7a37423..8926aa5 100644 --- a/technic/tools/tree_tap.lua +++ b/technic/tools/tree_tap.lua @@ -38,8 +38,8 @@ minetest.register_tool("technic:treetap", { minetest.register_craft({ output = "technic:treetap", recipe = { - {"pipeworks:tube_1", "group:wood", stick_ingrediant}, - {"", stick_ingrediant, stick_ingrediant} + {"pipeworks:tube_1", "group:wood", stick_ingredient}, + {"", stick_ingredient, stick_ingredient} }, }) diff --git a/technic_chests/copper_chest.lua b/technic_chests/copper_chest.lua index 47241b7..dca3989 100644 --- a/technic_chests/copper_chest.lua +++ b/technic_chests/copper_chest.lua @@ -1,18 +1,18 @@ minetest.register_craft({ output = 'technic:copper_chest 1', recipe = { - {copper_ingrediant,copper_ingrediant,copper_ingrediant}, - {copper_ingrediant,'technic:iron_chest',copper_ingrediant}, - {copper_ingrediant,copper_ingrediant,copper_ingrediant}, + {copper_ingredient,copper_ingredient,copper_ingredient}, + {copper_ingredient,'technic:iron_chest',copper_ingredient}, + {copper_ingredient,copper_ingredient,copper_ingredient}, } }) minetest.register_craft({ output = 'technic:copper_locked_chest 1', recipe = { - {copper_ingrediant,copper_ingrediant,copper_ingrediant}, - {copper_ingrediant,'technic:iron_locked_chest',copper_ingrediant}, - {copper_ingrediant,copper_ingrediant,copper_ingrediant}, + {copper_ingredient,copper_ingredient,copper_ingredient}, + {copper_ingredient,'technic:iron_locked_chest',copper_ingredient}, + {copper_ingredient,copper_ingredient,copper_ingredient}, } }) diff --git a/technic_chests/gold_chest.lua b/technic_chests/gold_chest.lua index 419cc96..bad26d1 100644 --- a/technic_chests/gold_chest.lua +++ b/technic_chests/gold_chest.lua @@ -11,18 +11,18 @@ for _, material in ipairs(material_list) do minetest.register_craft({ output = 'technic:gold_chest', recipe = { - {gold_ingot_ingrediant,gold_ingot_ingrediant,gold_ingot_ingrediant}, - {gold_ingot_ingrediant,"technic:"..material.."_chest",gold_ingot_ingrediant}, - {gold_ingot_ingrediant,gold_ingot_ingrediant,gold_ingot_ingrediant}, + {gold_ingot_ingredient,gold_ingot_ingredient,gold_ingot_ingredient}, + {gold_ingot_ingredient,"technic:"..material.."_chest",gold_ingot_ingredient}, + {gold_ingot_ingredient,gold_ingot_ingredient,gold_ingot_ingredient}, } }) minetest.register_craft({ output = 'technic:gold_locked_chest', recipe = { - {gold_ingot_ingrediant,gold_ingot_ingrediant,gold_ingot_ingrediant}, - {gold_ingot_ingrediant,"technic:"..material.."_locked_chest",gold_ingot_ingrediant}, - {gold_ingot_ingrediant,gold_ingot_ingrediant,gold_ingot_ingrediant}, + {gold_ingot_ingredient,gold_ingot_ingredient,gold_ingot_ingredient}, + {gold_ingot_ingredient,"technic:"..material.."_locked_chest",gold_ingot_ingredient}, + {gold_ingot_ingredient,gold_ingot_ingredient,gold_ingot_ingredient}, } }) end diff --git a/technic_chests/init.lua b/technic_chests/init.lua index 8984b3e..0f88909 100644 --- a/technic_chests/init.lua +++ b/technic_chests/init.lua @@ -4,6 +4,11 @@ local modpath = minetest.get_modpath("technic_chests") +-- Check if mcl_core or default is installed +if not minetest.get_modpath("mcl_core") and not minetest.get_modpath("default") then + error(minetest.get_current_modname().." ".."requires mcl_core or default to be installed (please install MTG or MCL2, or compatible games)") +end + -- Mineclone2 Support stone_sounds = nil if minetest.get_modpath("mcl_sounds") then @@ -27,46 +32,46 @@ else end -- Mineclone2 Recipes -chest_ingrediant = nil +chest_ingredient = nil if minetest.get_modpath("mcl_core") then - chest_ingrediant = "mcl_chests:chest" + chest_ingredient = "mcl_chests:chest" else - chest_ingrediant = "default:chest" + chest_ingredient = "default:chest" end -copper_ingrediant = nil +copper_ingredient = nil if minetest.get_modpath("mcl_core") then - copper_ingrediant = "mcl_copper:copper_ingot" + copper_ingredient = "mcl_copper:copper_ingot" else - copper_ingrediant = 'default:copper_ingot' + copper_ingredient = 'default:copper_ingot' end -gold_ingot_ingrediant = nil +gold_ingot_ingredient = nil if minetest.get_modpath("mcl_core") then - gold_ingot_ingrediant = "mcl_core:gold_ingot" + gold_ingot_ingredient = "mcl_core:gold_ingot" else - gold_ingot_ingrediant = 'default:gold_ingot' + gold_ingot_ingredient = 'default:gold_ingot' end -granite_ingrediant = nil +granite_ingredient = nil if minetest.get_modpath("mcl_core") then - granite_ingrediant = "mcl_core:granite" + granite_ingredient = "mcl_core:granite" else - granite_ingrediant = 'technic:granite' + granite_ingredient = 'technic:granite' end -granite_bricks_ingrediant = nil +granite_bricks_ingredient = nil if minetest.get_modpath("mcl_core") then - granite_bricks_ingrediant = "mcl_core:granite_smooth" + granite_bricks_ingredient = "mcl_core:granite_smooth" else - granite_bricks_ingrediant = 'technic:granite_bricks' + granite_bricks_ingredient = 'technic:granite_bricks' end -coal_ingrediant = nil +coal_ingredient = nil if minetest.get_modpath("mcl_core") then - coal_ingrediant = "group:coal" + coal_ingredient = "group:coal" else - coal_ingrediant = "default:coal_lump" + coal_ingredient = "default:coal_lump" end technic = rawget(_G, "technic") or {} diff --git a/technic_chests/iron_chest.lua b/technic_chests/iron_chest.lua index 49717a3..e44eafe 100644 --- a/technic_chests/iron_chest.lua +++ b/technic_chests/iron_chest.lua @@ -9,7 +9,7 @@ minetest.register_craft({ output = 'technic:iron_chest 1', recipe = { {cast_iron_ingot,cast_iron_ingot,cast_iron_ingot}, - {cast_iron_ingot,chest_ingrediant,cast_iron_ingot}, + {cast_iron_ingot,chest_ingredient,cast_iron_ingot}, {cast_iron_ingot,cast_iron_ingot,cast_iron_ingot}, } }) diff --git a/technic_chests/mod.conf b/technic_chests/mod.conf index 0556e50..626a825 100644 --- a/technic_chests/mod.conf +++ b/technic_chests/mod.conf @@ -1,4 +1,4 @@ name = technic_chests depends = basic_materials optional_depends = moreblocks, moreores, pipeworks, intllib, tubelib, default, mcl_core -supported_games = minetest_game,mineclone2 \ No newline at end of file +supported_games = minetest_game,mineclone2,mineclonia,mineclone5 \ No newline at end of file diff --git a/technic_cnc/cnc.lua b/technic_cnc/cnc.lua index fed1b3c..841b50e 100644 --- a/technic_cnc/cnc.lua +++ b/technic_cnc/cnc.lua @@ -19,7 +19,7 @@ if technic_cnc.use_technic then minetest.register_craft({ output = 'technic:cnc', recipe = { - {glass_ingrediant, 'technic:diamond_drill_head', glass_ingrediant}, + {glass_ingredient, 'technic:diamond_drill_head', glass_ingredient}, {'technic:control_logic_unit', 'technic:machine_casing', 'basic_materials:motor'}, {'technic:carbon_steel_ingot', 'technic:lv_cable', 'technic:carbon_steel_ingot'}, }, @@ -34,9 +34,9 @@ else minetest.register_craft({ output = 'technic:cnc', recipe = { - {glass_ingrediant, diamond_ingrediant, glass_ingrediant}, + {glass_ingredient, diamond_ingredient, glass_ingredient}, {'basic_materials:ic', 'default:steelblock', 'basic_materials:motor'}, - {'default:steel_ingot', mese_block_ingrediant, 'default:steel_ingot'}, + {'default:steel_ingot', mese_block_ingredient, 'default:steel_ingot'}, }, }) diff --git a/technic_cnc/init.lua b/technic_cnc/init.lua index f1cb03b..84861d3 100644 --- a/technic_cnc/init.lua +++ b/technic_cnc/init.lua @@ -23,6 +23,14 @@ else end end +local S = technic_cnc.getter + +-- Check if mcl_core or default is installed +if not minetest.get_modpath("mcl_core") and not minetest.get_modpath("default") then + error(S(minetest.get_current_modname()).." "..S("requires mcl_core or default to be installed (please install MTG or MCL2, or compatible games)")) +end + + dofile(modpath.."/cnc.lua") dofile(modpath.."/cnc_api.lua") dofile(modpath.."/cnc_materials.lua") diff --git a/technic_cnc/mod.conf b/technic_cnc/mod.conf index 300fdd8..b58bf3d 100644 --- a/technic_cnc/mod.conf +++ b/technic_cnc/mod.conf @@ -1,4 +1,4 @@ name = technic_cnc depends = basic_materials optional_depends = technic, default, mcl_core -supported_games = minetest_game,mineclone2 \ No newline at end of file +supported_games = minetest_game,mineclone2,mineclonia,mineclone5 \ No newline at end of file diff --git a/technic_worldgen/init.lua b/technic_worldgen/init.lua index dbd5f0c..c4b81b3 100644 --- a/technic_worldgen/init.lua +++ b/technic_worldgen/init.lua @@ -1,39 +1,19 @@ local modpath = minetest.get_modpath("technic_worldgen") + -- Mineclone Support -stone_sounds = nil -if minetest.get_modpath("mcl_sounds") then - stone_sounds = mcl_sounds.node_sound_stone_defaults() -else - stone_sounds = default.node_sound_stone_defaults() -end - -node_sounds = nil -if minetest.get_modpath("mcl_sounds") then - node_sounds = mcl_sounds.node_sound_defaults() -else - node_sounds = default.node_sound_defaults() -end - -wood_sounds = nil -if minetest.get_modpath("mcl_sounds") then - wood_sounds = mcl_sounds.node_sound_wood_defaults() -else - wood_sounds = default.node_sound_wood_defaults() -end - -leaves_sounds = nil -if minetest.get_modpath("mcl_sounds") then - leaves_sounds = mcl_sounds.node_sound_leaves_defaults() -else - leaves_sounds = default.node_sound_leaves_defaults() -end +sounds = minetest.get_modpath("mcl_sounds") and mcl_sounds or default technic = rawget(_G, "technic") or {} technic.worldgen = { gettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end, } +-- Check if mcl_core or default is installed +if not minetest.get_modpath("mcl_core") and not minetest.get_modpath("default") then + error(minetest.get_current_modname().." ".."requires mcl_core or default to be installed (please install MTG or MCL2, or compatible games)") +end + dofile(modpath.."/config.lua") dofile(modpath.."/nodes.lua") dofile(modpath.."/oregen.lua") diff --git a/technic_worldgen/mod.conf b/technic_worldgen/mod.conf index 4215a15..94fb64d 100644 --- a/technic_worldgen/mod.conf +++ b/technic_worldgen/mod.conf @@ -1,4 +1,4 @@ name = technic_worldgen depends = basic_materials optional_depends = intllib, mg, doors, farming, glooptest, mesecons_doors, vessels, default, mcl_core, mcl_sounds -supported_games = minetest_game,mineclone2 +supported_games = minetest_game,mineclone2,mineclonia,mineclone5 diff --git a/technic_worldgen/nodes.lua b/technic_worldgen/nodes.lua index ad70d63..011f62f 100644 --- a/technic_worldgen/nodes.lua +++ b/technic_worldgen/nodes.lua @@ -6,7 +6,7 @@ minetest.register_node( ":technic:mineral_uranium", { tiles = { "default_stone.png^technic_mineral_uranium.png" }, is_ground_content = true, groups = {cracky=3, radioactive=1,pickaxey=5,material_stone=1}, - sounds = stone_sounds, + sounds = sounds.node_sound_stone_defaults(), drop = "technic:uranium_lump", _mcl_hardness = 5, _mcl_blast_resistance = 3, @@ -19,7 +19,7 @@ minetest.register_node( ":technic:mineral_chromium", { tiles = { "default_stone.png^technic_mineral_chromium.png" }, is_ground_content = true, groups = {cracky=3,pickaxey=3,material_stone=1}, - sounds = stone_sounds, + sounds = sounds.node_sound_stone_defaults(), drop = "technic:chromium_lump", _mcl_hardness = 3, _mcl_blast_resistance = 3, @@ -32,7 +32,7 @@ minetest.register_node( ":technic:mineral_zinc", { tiles = { "default_stone.png^technic_mineral_zinc.png" }, is_ground_content = true, groups = {cracky=3,pickaxey=2,material_stone=1}, - sounds = stone_sounds, + sounds = sounds.node_sound_stone_defaults(), drop = "technic:zinc_lump", _mcl_hardness = 2, _mcl_blast_resistance = 3, @@ -45,7 +45,7 @@ minetest.register_node( ":technic:mineral_lead", { tiles = { "default_stone.png^technic_mineral_lead.png" }, is_ground_content = true, groups = {cracky=3,pickaxey=2,material_stone=1}, - sounds = stone_sounds, + sounds = sounds.node_sound_stone_defaults(), drop = "technic:lead_lump", _mcl_hardness = 2, _mcl_blast_resistance = 3, @@ -58,7 +58,7 @@ minetest.register_node( ":technic:mineral_sulfur", { tiles = { "default_stone.png^technic_mineral_sulfur.png" }, is_ground_content = true, groups = {cracky=3,pickaxey=1,material_stone=1}, - sounds = stone_sounds, + sounds = sounds.node_sound_stone_defaults(), drop = "technic:sulfur_lump", _mcl_hardness = 1, _mcl_blast_resistance = 3, @@ -67,22 +67,22 @@ minetest.register_node( ":technic:mineral_sulfur", { }) if minetest.get_modpath("default") then -minetest.register_node( ":technic:granite", { - description = S("Granite"), - tiles = { "technic_granite.png" }, - is_ground_content = true, - groups = {cracky=1}, - sounds = stone_sounds, -}) + minetest.register_node( ":technic:granite", { + description = S("Granite"), + tiles = { "technic_granite.png" }, + is_ground_content = true, + groups = {cracky=1}, + sounds = sounds.node_sound_stone_defaults(), + }) -minetest.register_node( ":technic:granite_bricks", { - description = S("Granite Bricks"), - tiles = { "technic_granite_bricks.png" }, - is_ground_content = false, - groups = {cracky=1}, - sounds = stone_sounds, -}) + minetest.register_node( ":technic:granite_bricks", { + description = S("Granite Bricks"), + tiles = { "technic_granite_bricks.png" }, + is_ground_content = false, + groups = {cracky=1}, + sounds = sounds.node_sound_stone_defaults(), + }) end minetest.register_node( ":technic:marble", { @@ -90,7 +90,7 @@ minetest.register_node( ":technic:marble", { tiles = { "technic_marble.png" }, is_ground_content = true, groups = {cracky=3, marble=1,pickaxey=3}, - sounds = stone_sounds, + sounds = sounds.node_sound_stone_defaults(), _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, @@ -102,7 +102,7 @@ minetest.register_node( ":technic:marble_bricks", { tiles = { "technic_marble_bricks.png" }, is_ground_content = false, groups = {cracky=3,pickaxey=3}, - sounds = stone_sounds, + sounds = sounds.node_sound_stone_defaults(), _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, @@ -114,7 +114,7 @@ minetest.register_node(":technic:uranium_block", { tiles = { "technic_uranium_block.png" }, is_ground_content = true, groups = {uranium_block=1, cracky=1, level=2, radioactive=2,pickaxey=5}, - sounds = stone_sounds, + sounds = sounds.node_sound_stone_defaults(), _mcl_hardness = 5, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, @@ -126,7 +126,7 @@ minetest.register_node(":technic:chromium_block", { tiles = { "technic_chromium_block.png" }, is_ground_content = true, groups = {cracky=1, level=2,pickaxey=4}, - sounds = stone_sounds, + sounds = sounds.node_sound_stone_defaults(), _mcl_hardness = 4, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, @@ -138,7 +138,7 @@ minetest.register_node(":technic:zinc_block", { tiles = { "technic_zinc_block.png" }, is_ground_content = true, groups = {cracky=1, level=2,pickaxey=3}, - sounds = stone_sounds, + sounds = sounds.node_sound_stone_defaults(), _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, @@ -150,7 +150,7 @@ minetest.register_node(":technic:lead_block", { tiles = { "technic_lead_block.png" }, is_ground_content = true, groups = {cracky=1, level=2,pickaxey=5}, - sounds = stone_sounds, + sounds = sounds.node_sound_stone_defaults(), _mcl_hardness = 5, _mcl_blast_resistance = 5, _mcl_silk_touch_drop = true, @@ -158,12 +158,12 @@ minetest.register_node(":technic:lead_block", { }) if minetest.get_modpath("default") then -minetest.register_alias("technic:wrought_iron_block", "default:steelblock") + minetest.register_alias("technic:wrought_iron_block", "default:steelblock") -minetest.override_item("default:steelblock", { - description = S("Wrought Iron Block"), - tiles = { "technic_wrought_iron_block.png" }, -}) + minetest.override_item("default:steelblock", { + description = S("Wrought Iron Block"), + tiles = { "technic_wrought_iron_block.png" }, + }) end minetest.register_node(":technic:cast_iron_block", { @@ -171,7 +171,7 @@ minetest.register_node(":technic:cast_iron_block", { tiles = { "technic_cast_iron_block.png" }, is_ground_content = true, groups = {cracky=1, level=2}, - sounds = stone_sounds, + sounds = sounds.node_sound_stone_defaults(), _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, @@ -183,7 +183,7 @@ minetest.register_node(":technic:carbon_steel_block", { tiles = { "technic_carbon_steel_block.png" }, is_ground_content = true, groups = {cracky=1, level=2}, - sounds = stone_sounds, + sounds = sounds.node_sound_stone_defaults(), _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, @@ -195,7 +195,7 @@ minetest.register_node(":technic:stainless_steel_block", { tiles = { "technic_stainless_steel_block.png" }, is_ground_content = true, groups = {cracky=1, level=2}, - sounds = stone_sounds, + sounds = sounds.node_sound_stone_defaults(), _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, @@ -203,13 +203,13 @@ minetest.register_node(":technic:stainless_steel_block", { }) if minetest.get_modpath("default") then -minetest.register_craft({ - output = 'technic:granite_bricks 4', - recipe = { - {granite_ingrediant,granite_ingrediant}, - {granite_ingrediant,granite_ingrediant} - } -}) + minetest.register_craft({ + output = 'technic:granite_bricks 4', + recipe = { + {granite_ingredient,granite_ingredient}, + {granite_ingredient,granite_ingredient} + } + }) end minetest.register_craft({ @@ -236,35 +236,34 @@ local function for_each_registered_node(action) end if minetest.get_modpath("default") then - -for_each_registered_node(function(node_name, node_def) - if node_name ~= "default:steelblock" and - node_name:find("steelblock", 1, true) and - node_def.description:find("Steel", 1, true) then - minetest.override_item(node_name, { - description = node_def.description:gsub("Steel", S("Wrought Iron")), - }) - end - local tiles = node_def.tiles or node_def.tile_images - if tiles then - local new_tiles = {} - local do_override = false - if type(tiles) == "string" then - tiles = {tiles} - end - for i, t in ipairs(tiles) do - if type(t) == "string" and t == "default_steel_block.png" then - do_override = true - t = "technic_wrought_iron_block.png" - end - table.insert(new_tiles, t) - end - if do_override then + for_each_registered_node(function(node_name, node_def) + if node_name ~= "default:steelblock" and + node_name:find("steelblock", 1, true) and + node_def.description:find("Steel", 1, true) then minetest.override_item(node_name, { - tiles = new_tiles + description = node_def.description:gsub("Steel", S("Wrought Iron")), }) end - end -end) + local tiles = node_def.tiles or node_def.tile_images + if tiles then + local new_tiles = {} + local do_override = false + if type(tiles) == "string" then + tiles = {tiles} + end + for i, t in ipairs(tiles) do + if type(t) == "string" and t == "default_steel_block.png" then + do_override = true + t = "technic_wrought_iron_block.png" + end + table.insert(new_tiles, t) + end + if do_override then + minetest.override_item(node_name, { + tiles = new_tiles + }) + end + end + end) end \ No newline at end of file diff --git a/technic_worldgen/rubber.lua b/technic_worldgen/rubber.lua index aaea86a..fea1346 100644 --- a/technic_worldgen/rubber.lua +++ b/technic_worldgen/rubber.lua @@ -11,7 +11,7 @@ minetest.register_node(":moretrees:rubber_tree_sapling", { paramtype = "light", walkable = false, groups = {dig_immediate=3, flammable=2, sapling=1}, - sounds = node_sounds, + sounds = sounds.node_sound_defaults(), }) minetest.register_craft({ @@ -26,7 +26,7 @@ minetest.register_node(":moretrees:rubber_tree_trunk", { "technic_rubber_tree_full.png"}, groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2}, - sounds = wood_sounds, + sounds = sounds.node_sound_wood_defaults(), }) minetest.register_node(":moretrees:rubber_tree_trunk_empty", { @@ -35,7 +35,7 @@ minetest.register_node(":moretrees:rubber_tree_trunk_empty", { "technic_rubber_tree_empty.png"}, groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2, not_in_creative_inventory=1}, - sounds = wood_sounds, + sounds = sounds.node_sound_wood_defaults(), }) minetest.register_node(":moretrees:rubber_tree_leaves", { @@ -55,7 +55,7 @@ minetest.register_node(":moretrees:rubber_tree_leaves", { } } }, - sounds = leaves_sounds, + sounds = sounds.node_sound_leaves_defaults() }) technic.rubber_tree_model={ diff --git a/wrench/init.lua b/wrench/init.lua index 7696df5..d71ab2a 100644 --- a/wrench/init.lua +++ b/wrench/init.lua @@ -13,6 +13,11 @@ available to survival-mode players. local LATEST_SERIALIZATION_VERSION = 1 +-- Check if mcl_core or default is installed +if not minetest.get_modpath("mcl_core") and not minetest.get_modpath("default") then + error(minetest.get_current_modname().." ".."requires mcl_core or default to be installed (please install MTG or MCL2, or compatible games)") +end + wrench = {} local modpath = minetest.get_modpath(minetest.get_current_modname()) diff --git a/wrench/mod.conf b/wrench/mod.conf index b292c49..d12fe53 100644 --- a/wrench/mod.conf +++ b/wrench/mod.conf @@ -1,3 +1,3 @@ name = wrench optional_depends = technic, technic_chests, technic_worldgen, intllib, default, mcl_core -supported_games = minetest_game,mineclone2 \ No newline at end of file +supported_games = minetest_game,mineclone2,mineclonia,mineclone5 \ No newline at end of file diff --git a/wrench/support.lua b/wrench/support.lua index 80df230..9be4c3e 100644 --- a/wrench/support.lua +++ b/wrench/support.lua @@ -23,7 +23,7 @@ local STRING, FLOAT = wrench.META_TYPE_FLOAT wrench.registered_nodes = { - [chest_ingrediant] = { + [chest_ingredient] = { lists = {"main"}, }, ["default:chest_locked"] = { From 58df66b7bc0a5cde4e1e9b603bfad28eed9f1fad Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Wed, 27 Dec 2023 17:11:42 +0000 Subject: [PATCH 19/32] Major refactor, put compat ingredients in namespace tables --- refactor.py | 40 ---- technic/crafts.lua | 46 ++--- technic/items.lua | 4 +- technic/machines/HV/forcefield.lua | 6 +- technic/machines/HV/nuclear_reactor.lua | 6 +- technic/machines/LV/alloy_furnace.lua | 6 +- technic/machines/LV/cables.lua | 6 +- technic/machines/LV/compressor.lua | 2 +- technic/machines/LV/electric_furnace.lua | 6 +- technic/machines/LV/generator.lua | 6 +- technic/machines/LV/geothermal.lua | 8 +- technic/machines/LV/grinder.lua | 6 +- technic/machines/LV/lamp.lua | 2 +- technic/machines/LV/music_player.lua | 8 +- technic/machines/LV/solar_panel.lua | 2 +- technic/machines/LV/water_mill.lua | 6 +- technic/machines/MV/hydro_turbine.lua | 4 +- technic/machines/MV/lighting.lua | 24 +-- technic/machines/MV/power_radiator.lua | 2 +- technic/machines/MV/tool_workshop.lua | 6 +- technic/machines/MV/wind_mill.lua | 4 +- technic/machines/other/anchor.lua | 2 +- technic/machines/other/coal_alloy_furnace.lua | 10 +- technic/machines/other/constructor.lua | 4 +- technic/machines/other/frames.lua | 4 +- technic/machines/other/injector.lua | 4 +- technic/machines/power_monitor.lua | 4 +- technic/machines/register/battery_box.lua | 6 +- technic/machines/register/cables.lua | 4 +- technic/machines/register/common.lua | 4 +- technic/machines/register/generator.lua | 4 +- technic/machines/register/grinder_recipes.lua | 6 +- technic/machines/register/machine_base.lua | 4 +- technic/machines/register/solar_array.lua | 2 +- technic/machines/supply_converter.lua | 2 +- technic/machines/switching_station.lua | 4 +- technic/mcl_craftguide.lua | 84 ++++---- technic/mcl_support.lua | 179 +++++++++--------- technic/radiation.lua | 8 +- technic/tools/cans.lua | 4 +- technic/tools/mining_drill.lua | 4 +- technic/tools/mining_lasers.lua | 12 +- technic/tools/sonic_screwdriver.lua | 6 +- technic/tools/tree_tap.lua | 4 +- technic_cnc/cnc.lua | 12 +- technic_cnc/init.lua | 8 + 46 files changed, 276 insertions(+), 309 deletions(-) delete mode 100644 refactor.py diff --git a/refactor.py b/refactor.py deleted file mode 100644 index ba43106..0000000 --- a/refactor.py +++ /dev/null @@ -1,40 +0,0 @@ -import os -import re - -# Define the directory path of the project here -# For this example, I'm just using a placeholder path -# You would replace this with the path to your project directory -project_directory = './technic' - -# Regex to find all lines with either _ingredient or _sounds variables -variable_regex = re.compile(r'(\w+)(_ingredient|_sounds) = (.*)') - -# Function to refactor a single file -def refactor_file(file_path): - changes_made = False - with open(file_path, 'r') as file: - lines = file.readlines() - - with open(file_path, 'w') as file: - for line in lines: - match = variable_regex.search(line) - if match: - variable_name = match.group(1) + match.group(2) - new_line = f'technic.compat.{variable_name} = {match.group(3)}\n' - file.write(new_line) - changes_made = True - else: - file.write(line) - return changes_made - -# Function to walk through the project directory and refactor all files -def refactor_project(directory): - for subdir, _, files in os.walk(directory): - for file in files: - file_path = os.path.join(subdir, file) - if file_path.endswith('.lua'): - if refactor_file(file_path): - print(f'Refactored {file_path}') - -# Run the refactoring on the project directory -refactor_project(project_directory) diff --git a/technic/crafts.lua b/technic/crafts.lua index eb75b41..530ab1d 100644 --- a/technic/crafts.lua +++ b/technic/crafts.lua @@ -38,9 +38,9 @@ if pipeworks.enable_teleport_tube then minetest.register_craft({ output = 'pipeworks:teleport_tube_1', recipe = { - {mese_crystal_ingredient, 'technic:copper_coil', mese_crystal_ingredient}, + {technic.compat.mese_crystal_ingredient, 'technic:copper_coil', technic.compat.mese_crystal_ingredient}, {'pipeworks:tube_1', 'technic:control_logic_unit', 'pipeworks:tube_1'}, - {mese_crystal_ingredient, 'technic:copper_coil', mese_crystal_ingredient}, + {technic.compat.mese_crystal_ingredient, 'technic:copper_coil', technic.compat.mese_crystal_ingredient}, } }) end @@ -62,36 +62,36 @@ minetest.register_craft( { minetest.register_craft({ output = 'technic:diamond_drill_head', recipe = { - {'technic:stainless_steel_ingot', diamond_ingredient, 'technic:stainless_steel_ingot'}, - {diamond_ingredient, '', diamond_ingredient}, - {'technic:stainless_steel_ingot', diamond_ingredient, 'technic:stainless_steel_ingot'}, + {'technic:stainless_steel_ingot', technic.compat.diamond_ingredient, 'technic:stainless_steel_ingot'}, + {technic.compat.diamond_ingredient, '', technic.compat.diamond_ingredient}, + {'technic:stainless_steel_ingot', technic.compat.diamond_ingredient, 'technic:stainless_steel_ingot'}, } }) minetest.register_craft({ output = 'technic:green_energy_crystal', recipe = { - {gold_ingot_ingredient, 'technic:battery', green_dye_ingredient}, + {technic.compat.gold_ingot_ingredient, 'technic:battery', technic.compat.green_dye_ingredient}, {'technic:battery', 'technic:red_energy_crystal', 'technic:battery'}, - {green_dye_ingredient, 'technic:battery', gold_ingot_ingredient}, + {technic.compat.green_dye_ingredient, 'technic:battery', technic.compat.gold_ingot_ingredient}, } }) minetest.register_craft({ output = 'technic:blue_energy_crystal', recipe = { - {'moreores:mithril_ingot', 'technic:battery', blue_dye_ingredient}, + {'moreores:mithril_ingot', 'technic:battery', technic.compat.blue_dye_ingredient}, {'technic:battery', 'technic:green_energy_crystal', 'technic:battery'}, - {blue_dye_ingredient, 'technic:battery', 'moreores:mithril_ingot'}, + {technic.compat.blue_dye_ingredient, 'technic:battery', 'moreores:mithril_ingot'}, } }) minetest.register_craft({ output = 'technic:red_energy_crystal', recipe = { - {'moreores:silver_ingot', 'technic:battery', red_dye_ingredient}, + {'moreores:silver_ingot', 'technic:battery', technic.compat.red_dye_ingredient}, {'technic:battery', 'basic_materials:energy_crystal_simple', 'technic:battery'}, - {red_dye_ingredient, 'technic:battery', 'moreores:silver_ingot'}, + {technic.compat.red_dye_ingredient, 'technic:battery', 'moreores:silver_ingot'}, } }) @@ -143,7 +143,7 @@ minetest.register_craft({ output = 'technic:control_logic_unit', recipe = { {'', 'basic_materials:gold_wire', ''}, - {copper_ingredient, 'technic:silicon_wafer', copper_ingredient}, + {technic.compat.copper_ingredient, 'technic:silicon_wafer', technic.compat.copper_ingredient}, {'', 'technic:chromium_ingot', ''}, }, replacements = { {"basic_materials:gold_wire", "basic_materials:empty_spool"}, }, @@ -153,8 +153,8 @@ minetest.register_craft({ output = 'technic:mixed_metal_ingot 9', recipe = { {'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'}, - {bronze_ingredient, bronze_ingredient, bronze_ingredient}, - {tin_ingredient, tin_ingredient, tin_ingredient}, + {technic.compat.bronze_ingredient, technic.compat.bronze_ingredient, technic.compat.bronze_ingredient}, + {technic.compat.tin_ingredient, technic.compat.tin_ingredient, technic.compat.tin_ingredient}, } }) @@ -175,7 +175,7 @@ minetest.register_craft({ }) minetest.register_craft({ - output = dirt_ingredient.." 2", + output = technic.compat.dirt_ingredient.." 2", type = "shapeless", replacements = {{"bucket:bucket_water","bucket:bucket_empty"}}, recipe = { @@ -191,14 +191,14 @@ minetest.register_craft({ type = "shapeless", recipe = { "technic:raw_latex", - coal_ingredient, - coal_ingredient, - coal_ingredient, - coal_ingredient, - coal_ingredient, - coal_ingredient, - coal_ingredient, - coal_ingredient, + technic.compat.coal_ingredient, + technic.compat.coal_ingredient, + technic.compat.coal_ingredient, + technic.compat.coal_ingredient, + technic.compat.coal_ingredient, + technic.compat.coal_ingredient, + technic.compat.coal_ingredient, + technic.compat.coal_ingredient, }, }) diff --git a/technic/items.lua b/technic/items.lua index 9da6466..ab2bed7 100644 --- a/technic/items.lua +++ b/technic/items.lua @@ -131,7 +131,7 @@ minetest.register_node("technic:machine_casing", { paramtype = "light", drawtype = "allfaces", tiles = {"technic_machine_casing.png"}, - sounds = stone_sounds, + sounds = technic.compat.stone_sounds, }) minetest.register_craftitem("technic:rubber_goo", { @@ -188,7 +188,7 @@ for p = 0, 35 do is_ground_content = true, groups = {uranium_block=1, not_in_creative_inventory=nici, cracky=1, level=2, radioactive=radioactivity}, - sounds = stone_sounds, + sounds = technic.compat.stone_sounds, }); if not ov then minetest.register_craft({ diff --git a/technic/machines/HV/forcefield.lua b/technic/machines/HV/forcefield.lua index 792aba6..c7dfc1c 100644 --- a/technic/machines/HV/forcefield.lua +++ b/technic/machines/HV/forcefield.lua @@ -17,9 +17,9 @@ local cable_entry = "^technic_cable_connection_overlay.png" minetest.register_craft({ output = "technic:forcefield_emitter_off", recipe = { - {mese_block_ingredient, "basic_materials:motor", mese_block_ingredient}, + {technic.compat.mese_block_ingredient, "basic_materials:motor", technic.compat.mese_block_ingredient}, {"technic:deployer_off", "technic:machine_casing", "technic:deployer_off"}, - {mese_block_ingredient, "technic:hv_cable", mese_block_ingredient}, + {technic.compat.mese_block_ingredient, "technic:hv_cable", technic.compat.mese_block_ingredient}, } }) @@ -354,7 +354,7 @@ minetest.register_node("technic:forcefield", { drawtype = "glasslike", groups = {not_in_creative_inventory=1}, paramtype = "light", - light_source = mt_light_max, + light_source = technic.compat.mt_light_max, diggable = false, drop = '', tiles = {{ diff --git a/technic/machines/HV/nuclear_reactor.lua b/technic/machines/HV/nuclear_reactor.lua index 43c6bf6..656b5d0 100644 --- a/technic/machines/HV/nuclear_reactor.lua +++ b/technic/machines/HV/nuclear_reactor.lua @@ -24,7 +24,7 @@ local cable_entry = "^technic_cable_connection_overlay.png" minetest.register_craft({ output = 'technic:hv_nuclear_reactor_core', recipe = { - {'technic:carbon_plate', obsidian_glass_ingredient, 'technic:carbon_plate'}, + {'technic:carbon_plate', technic.compat.obsidian_glass_ingredient, 'technic:carbon_plate'}, {'technic:composite_plate', 'technic:machine_casing', 'technic:composite_plate'}, {'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'}, } @@ -414,7 +414,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core", { mesh = "technic_reactor.obj", groups = {cracky = 1, technic_machine = 1, technic_hv = 1, digiline_remote_receive = 1}, legacy_facedir_simple = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, paramtype = "light", paramtype2 = "facedir", stack_max = 1, @@ -449,7 +449,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core_active", { groups = {cracky = 1, technic_machine = 1, technic_hv = 1, radioactive = 4, not_in_creative_inventory = 1, digiline_remote_receive = 1}, legacy_facedir_simple = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, drop = "technic:hv_nuclear_reactor_core", light_source = 14, paramtype = "light", diff --git a/technic/machines/LV/alloy_furnace.lua b/technic/machines/LV/alloy_furnace.lua index db35d73..a16972a 100644 --- a/technic/machines/LV/alloy_furnace.lua +++ b/technic/machines/LV/alloy_furnace.lua @@ -4,9 +4,9 @@ minetest.register_craft({ output = 'technic:lv_alloy_furnace', recipe = { - {brick_block_ingredient, brick_block_ingredient, brick_block_ingredient}, - {brick_block_ingredient, 'technic:machine_casing', brick_block_ingredient}, - {brick_block_ingredient, 'technic:lv_cable', brick_block_ingredient}, + {technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient}, + {technic.compat.brick_block_ingredient, 'technic:machine_casing', technic.compat.brick_block_ingredient}, + {technic.compat.brick_block_ingredient, 'technic:lv_cable', technic.compat.brick_block_ingredient}, } }) diff --git a/technic/machines/LV/cables.lua b/technic/machines/LV/cables.lua index cb12032..8fcc0e7 100644 --- a/technic/machines/LV/cables.lua +++ b/technic/machines/LV/cables.lua @@ -4,9 +4,9 @@ minetest.register_alias("lv_cable", "technic:lv_cable") minetest.register_craft({ output = 'technic:lv_cable 6', recipe = { - {paper_ingredient, paper_ingredient, paper_ingredient}, - {copper_ingredient, copper_ingredient, copper_ingredient}, - {paper_ingredient, paper_ingredient, paper_ingredient}, + {technic.compat.paper_ingredient, technic.compat.paper_ingredient, technic.compat.paper_ingredient}, + {technic.compat.copper_ingredient, technic.compat.copper_ingredient, technic.compat.copper_ingredient}, + {technic.compat.paper_ingredient, technic.compat.paper_ingredient, technic.compat.paper_ingredient}, } }) diff --git a/technic/machines/LV/compressor.lua b/technic/machines/LV/compressor.lua index d300cbc..5c1d089 100644 --- a/technic/machines/LV/compressor.lua +++ b/technic/machines/LV/compressor.lua @@ -4,7 +4,7 @@ minetest.register_alias("compressor", "technic:lv_compressor") minetest.register_craft({ output = 'technic:lv_compressor', recipe = { - {stone_ingredient, 'basic_materials:motor', stone_ingredient}, + {technic.compat.stone_ingredient, 'basic_materials:motor', technic.compat.stone_ingredient}, {'mesecons:piston', 'technic:machine_casing', 'mesecons:piston'}, {'basic_materials:silver_wire', 'technic:lv_cable', 'basic_materials:silver_wire'}, }, diff --git a/technic/machines/LV/electric_furnace.lua b/technic/machines/LV/electric_furnace.lua index 53f3a58..efb0cfe 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 = { - {cobble_ingredient, cobble_ingredient, cobble_ingredient}, - {cobble_ingredient, 'technic:machine_casing', cobble_ingredient}, - {cobble_ingredient, 'technic:lv_cable', cobble_ingredient}, + {technic.compat.cobble_ingredient, technic.compat.cobble_ingredient, technic.compat.cobble_ingredient}, + {technic.compat.cobble_ingredient, 'technic:machine_casing', technic.compat.cobble_ingredient}, + {technic.compat.cobble_ingredient, 'technic:lv_cable', technic.compat.cobble_ingredient}, } }) diff --git a/technic/machines/LV/generator.lua b/technic/machines/LV/generator.lua index 5ff9e9f..66a9db4 100644 --- a/technic/machines/LV/generator.lua +++ b/technic/machines/LV/generator.lua @@ -8,9 +8,9 @@ minetest.register_alias("lv_generator", "technic:lv_generator") minetest.register_craft({ output = 'technic:lv_generator', recipe = { - {stone_ingredient, furnace_ingredient, stone_ingredient}, - {stone_ingredient, 'technic:machine_casing', stone_ingredient}, - {stone_ingredient, 'technic:lv_cable', stone_ingredient}, + {technic.compat.stone_ingredient, technic.compat.furnace_ingredient, technic.compat.stone_ingredient}, + {technic.compat.stone_ingredient, 'technic:machine_casing', technic.compat.stone_ingredient}, + {technic.compat.stone_ingredient, 'technic:lv_cable', technic.compat.stone_ingredient}, } }) diff --git a/technic/machines/LV/geothermal.lua b/technic/machines/LV/geothermal.lua index 48aadd6..1bc1cc7 100644 --- a/technic/machines/LV/geothermal.lua +++ b/technic/machines/LV/geothermal.lua @@ -10,9 +10,9 @@ local S = technic.getter minetest.register_craft({ output = 'technic:geothermal', recipe = { - {granite_ingredient, diamond_ingredient, granite_ingredient}, + {technic.compat.granite_ingredient, technic.compat.diamond_ingredient, technic.compat.granite_ingredient}, {'basic_materials:copper_wire', 'technic:machine_casing', 'basic_materials:copper_wire'}, - {granite_ingredient, 'technic:lv_cable', granite_ingredient}, + {technic.compat.granite_ingredient, 'technic:lv_cable', technic.compat.granite_ingredient}, }, replacements = { {"basic_materials:copper_wire", "basic_materials:empty_spool"}, @@ -90,7 +90,7 @@ minetest.register_node("technic:geothermal", { technic_machine=1, technic_lv=1}, paramtype2 = "facedir", legacy_facedir_simple = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Geothermal %s Generator"):format("LV")) @@ -107,7 +107,7 @@ minetest.register_node("technic:geothermal_active", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1}, legacy_facedir_simple = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, drop = "technic:geothermal", technic_run = run, }) diff --git a/technic/machines/LV/grinder.lua b/technic/machines/LV/grinder.lua index d6354fe..ff42911 100644 --- a/technic/machines/LV/grinder.lua +++ b/technic/machines/LV/grinder.lua @@ -3,9 +3,9 @@ minetest.register_alias("grinder", "technic:lv_grinder") minetest.register_craft({ output = 'technic:lv_grinder', recipe = { - {desert_stone_ingredient, diamond_ingredient, desert_stone_ingredient}, - {desert_stone_ingredient, 'technic:machine_casing', desert_stone_ingredient}, - {granite_ingredient, 'technic:lv_cable', granite_ingredient}, + {technic.compat.desert_stone_ingredient, technic.compat.diamond_ingredient, technic.compat.desert_stone_ingredient}, + {technic.compat.desert_stone_ingredient, 'technic:machine_casing', technic.compat.desert_stone_ingredient}, + {technic.compat.granite_ingredient, 'technic:lv_cable', technic.compat.granite_ingredient}, } }) diff --git a/technic/machines/LV/lamp.lua b/technic/machines/LV/lamp.lua index 6d580bb..72c2b65 100644 --- a/technic/machines/LV/lamp.lua +++ b/technic/machines/LV/lamp.lua @@ -149,7 +149,7 @@ technic.register_machine("LV", "technic:lv_lamp_active", technic.receiver) minetest.register_craft({ output = "technic:lv_lamp", recipe = { - {glass_ingredient, glass_ingredient, glass_ingredient}, + {technic.compat.glass_ingredient, technic.compat.glass_ingredient, technic.compat.glass_ingredient}, {"technic:lv_led", "technic:lv_led", "technic:lv_led"}, {"mesecons_materials:glue", "technic:lv_cable", "mesecons_materials:glue"}, } diff --git a/technic/machines/LV/music_player.lua b/technic/machines/LV/music_player.lua index 272b5a8..b3b41e9 100644 --- a/technic/machines/LV/music_player.lua +++ b/technic/machines/LV/music_player.lua @@ -7,9 +7,9 @@ minetest.register_alias("music_player", "technic:music_player") minetest.register_craft({ output = 'technic:music_player', recipe = { - {'technic:chromium_ingot', diamond_ingredient, 'technic:chromium_ingot'}, - {diamond_ingredient, 'technic:machine_casing', diamond_ingredient}, - {mossy_cobble_ingredient, 'technic:lv_cable', mossy_cobble_ingredient}, + {'technic:chromium_ingot', technic.compat.diamond_ingredient, 'technic:chromium_ingot'}, + {technic.compat.diamond_ingredient, 'technic:machine_casing', technic.compat.diamond_ingredient}, + {technic.compat.mossy_cobble_ingredient, 'technic:lv_cable', technic.compat.mossy_cobble_ingredient}, } }) @@ -96,7 +96,7 @@ minetest.register_node("technic:music_player", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1}, connect_sides = {"bottom"}, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("%s Music Player"):format("LV")) diff --git a/technic/machines/LV/solar_panel.lua b/technic/machines/LV/solar_panel.lua index 4e5763b..a93549e 100644 --- a/technic/machines/LV/solar_panel.lua +++ b/technic/machines/LV/solar_panel.lua @@ -50,7 +50,7 @@ minetest.register_node("technic:solar_panel", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1}, connect_sides = {"bottom"}, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, description = S("Small Solar %s Generator"):format("LV"), active = false, drawtype = "nodebox", diff --git a/technic/machines/LV/water_mill.lua b/technic/machines/LV/water_mill.lua index 2fa8161..8fd7c73 100644 --- a/technic/machines/LV/water_mill.lua +++ b/technic/machines/LV/water_mill.lua @@ -11,7 +11,7 @@ minetest.register_alias("water_mill", "technic:water_mill") minetest.register_craft({ output = 'technic:water_mill', recipe = { - {'technic:marble', diamond_ingredient, 'technic:marble'}, + {'technic:marble', technic.compat.diamond_ingredient, 'technic:marble'}, {'group:wood', 'technic:machine_casing', 'group:wood'}, {'technic:marble', 'technic:lv_cable', 'technic:marble'}, } @@ -80,7 +80,7 @@ minetest.register_node("technic:water_mill", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1}, legacy_facedir_simple = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Hydro %s Generator"):format("LV")) @@ -98,7 +98,7 @@ minetest.register_node("technic:water_mill_active", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1}, legacy_facedir_simple = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, drop = "technic:water_mill", technic_run = run, technic_disabled_machine_name = "technic:water_mill", diff --git a/technic/machines/MV/hydro_turbine.lua b/technic/machines/MV/hydro_turbine.lua index b1a8704..818923e 100644 --- a/technic/machines/MV/hydro_turbine.lua +++ b/technic/machines/MV/hydro_turbine.lua @@ -77,7 +77,7 @@ minetest.register_node("technic:hydro_turbine", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_mv=1}, legacy_facedir_simple = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Hydro %s Generator"):format("MV")) @@ -95,7 +95,7 @@ minetest.register_node("technic:hydro_turbine_active", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_mv=1, not_in_creative_inventory=1}, legacy_facedir_simple = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, drop = "technic:hydro_turbine", technic_run = run, technic_disabled_machine_name = "technic:hydro_turbine", diff --git a/technic/machines/MV/lighting.lua b/technic/machines/MV/lighting.lua index 9f30f5b..c4913af 100644 --- a/technic/machines/MV/lighting.lua +++ b/technic/machines/MV/lighting.lua @@ -105,7 +105,7 @@ minetest.register_node('technic:homedecor_glowlight_half_yellow', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -145,7 +145,7 @@ minetest.register_node('technic:homedecor_glowlight_half_yellow_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_half_yellow", @@ -186,7 +186,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_yellow', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -226,7 +226,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_yellow_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX-1, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_quarter_yellow", @@ -268,7 +268,7 @@ minetest.register_node('technic:homedecor_glowlight_half_white', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -308,7 +308,7 @@ minetest.register_node('technic:homedecor_glowlight_half_white_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_half_white", @@ -349,7 +349,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_white', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -389,7 +389,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_white_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX-1, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_quarter_white", @@ -430,7 +430,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_yellow', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -470,7 +470,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_yellow_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX-1, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_small_cube_yellow", @@ -511,7 +511,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_white', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -551,7 +551,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_white_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX-1, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_small_cube_white", diff --git a/technic/machines/MV/power_radiator.lua b/technic/machines/MV/power_radiator.lua index f3a0701..c2ade73 100644 --- a/technic/machines/MV/power_radiator.lua +++ b/technic/machines/MV/power_radiator.lua @@ -123,7 +123,7 @@ minetest.register_node("technic:power_radiator", { tiles = {"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png"}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2}, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, drawtype = "nodebox", paramtype = "light", is_ground_content = true, diff --git a/technic/machines/MV/tool_workshop.lua b/technic/machines/MV/tool_workshop.lua index 82973c0..cf67096 100644 --- a/technic/machines/MV/tool_workshop.lua +++ b/technic/machines/MV/tool_workshop.lua @@ -10,9 +10,9 @@ local tube_entry = "^pipeworks_tube_connection_wooden.png" minetest.register_craft({ output = 'technic:tool_workshop', recipe = { - {'group:wood', diamond_ingredient, 'group:wood'}, + {'group:wood', technic.compat.diamond_ingredient, 'group:wood'}, {'mesecons_pistons:piston_sticky_off', 'technic:machine_casing', 'technic:carbon_cloth'}, - {obsidian_ingredient, 'technic:mv_cable', obsidian_ingredient}, + {technic.compat.obsidian_ingredient, 'technic:mv_cable', technic.compat.obsidian_ingredient}, } }) @@ -95,7 +95,7 @@ minetest.register_node("technic:tool_workshop", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_mv=1, tubedevice=1, tubedevice_receiver=1}, connect_sides = {"bottom", "back", "left", "right"}, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("%s Tool Workshop"):format("MV")) diff --git a/technic/machines/MV/wind_mill.lua b/technic/machines/MV/wind_mill.lua index c05b744..dd0c9bc 100644 --- a/technic/machines/MV/wind_mill.lua +++ b/technic/machines/MV/wind_mill.lua @@ -25,7 +25,7 @@ minetest.register_node("technic:wind_mill_frame", { tiles = {"technic_carbon_steel_block.png", "default_glass.png"}, sunlight_propagates = true, groups = {cracky=3}, - sounds = stone_sounds, + sounds = technic.compat.stone_sounds, paramtype = "light", }) @@ -72,7 +72,7 @@ minetest.register_node("technic:wind_mill", { paramtype2 = "facedir", groups = {cracky=1, technic_machine=1, technic_mv=1}, connect_sides = {"top", "bottom", "back", "left", "right"}, - sounds = stone_sounds, + sounds = technic.compat.stone_sounds, drawtype = "nodebox", paramtype = "light", node_box = { diff --git a/technic/machines/other/anchor.lua b/technic/machines/other/anchor.lua index a2d2f2c..9cccd7e 100644 --- a/technic/machines/other/anchor.lua +++ b/technic/machines/other/anchor.lua @@ -73,7 +73,7 @@ minetest.register_node("technic:admin_anchor", { tiles = {"technic_admin_anchor.png"}, is_ground_content = true, groups = {cracky=3, not_in_creative_inventory=1}, - sounds = stone_sounds, + sounds = technic.compat.stone_sounds, after_place_node = function (pos, placer) local meta = minetest.get_meta(pos) if placer and placer:is_player() then diff --git a/technic/machines/other/coal_alloy_furnace.lua b/technic/machines/other/coal_alloy_furnace.lua index d4584e0..1913411 100644 --- a/technic/machines/other/coal_alloy_furnace.lua +++ b/technic/machines/other/coal_alloy_furnace.lua @@ -6,9 +6,9 @@ local S = technic.getter minetest.register_craft({ output = 'technic:coal_alloy_furnace', recipe = { - {brick_block_ingredient, brick_block_ingredient, brick_block_ingredient}, - {brick_block_ingredient, '', brick_block_ingredient}, - {brick_block_ingredient, brick_block_ingredient, brick_block_ingredient}, + {technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient}, + {technic.compat.brick_block_ingredient, '', technic.compat.brick_block_ingredient}, + {technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient}, } }) @@ -36,7 +36,7 @@ minetest.register_node("technic:coal_alloy_furnace", { paramtype2 = "facedir", groups = {cracky=2}, legacy_facedir_simple = true, - sounds = stone_sounds, + sounds = technic.compat.stone_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("formspec", formspec) @@ -62,7 +62,7 @@ minetest.register_node("technic:coal_alloy_furnace_active", { drop = "technic:coal_alloy_furnace", groups = {cracky=2, not_in_creative_inventory=1}, legacy_facedir_simple = true, - sounds = stone_sounds, + sounds = technic.compat.stone_sounds, can_dig = technic.machine_can_dig, allow_metadata_inventory_put = technic.machine_inventory_put, allow_metadata_inventory_take = technic.machine_inventory_take, diff --git a/technic/machines/other/constructor.lua b/technic/machines/other/constructor.lua index 714354d..6565028 100644 --- a/technic/machines/other/constructor.lua +++ b/technic/machines/other/constructor.lua @@ -142,7 +142,7 @@ local function make_constructor(mark, length) groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, mesecon = 2, technic_constructor = 1}, mesecons = {effector = {action_on = make_on(mark, length)}}, - sounds = stone_sounds, + sounds = technic.compat.stone_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) local formspec = "size[8,9;]".. @@ -194,7 +194,7 @@ local function make_constructor(mark, length) groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, mesecon=2, not_in_creative_inventory=1, technic_constructor=1}, mesecons= {effector = {action_off = make_off(mark)}}, - sounds = stone_sounds, + sounds = technic.compat.stone_sounds, allow_metadata_inventory_put = allow_inventory_put, allow_metadata_inventory_take = technic.machine_inventory_take, allow_metadata_inventory_move = technic.machine_inventory_move, diff --git a/technic/machines/other/frames.lua b/technic/machines/other/frames.lua index 923adff..1b9e3ea 100644 --- a/technic/machines/other/frames.lua +++ b/technic/machines/other/frames.lua @@ -981,7 +981,7 @@ minetest.register_craft({ output = 'technic:template 10', recipe = { { '', 'basic_materials:brass_ingot', '' }, - { 'basic_materials:brass_ingot', mese_crystal_ingredient, 'basic_materials:brass_ingot' }, + { 'basic_materials:brass_ingot', technic.compat.mese_crystal_ingredient, 'basic_materials:brass_ingot' }, { '', 'basic_materials:brass_ingot', '' }, } }) @@ -1009,7 +1009,7 @@ minetest.register_craft({ output = 'technic:template_tool', recipe = { { '', 'technic:template', '' }, - { mese_crystal_ingredient, 'default:stick', mese_crystal_ingredient }, + { technic.compat.mese_crystal_ingredient, 'default:stick', technic.compat.mese_crystal_ingredient }, { '', 'default:stick', '' }, } }) diff --git a/technic/machines/other/injector.lua b/technic/machines/other/injector.lua index 8bc6a56..eda455f 100644 --- a/technic/machines/other/injector.lua +++ b/technic/machines/other/injector.lua @@ -47,7 +47,7 @@ minetest.register_craft({ output = 'technic:injector 1', recipe = { {'', 'technic:control_logic_unit',''}, - {'', chest_ingredient,''}, + {'', technic.compat.chest_ingredient,''}, {'', 'pipeworks:tube_1',''}, } }) @@ -105,7 +105,7 @@ minetest.register_node("technic:injector", { end, connect_sides = {left=1, right=1, back=1, top=1, bottom=1}, }, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Self-Contained Injector")) diff --git a/technic/machines/power_monitor.lua b/technic/machines/power_monitor.lua index 14e9863..19a9e35 100644 --- a/technic/machines/power_monitor.lua +++ b/technic/machines/power_monitor.lua @@ -10,7 +10,7 @@ minetest.register_craft({ output = "technic:power_monitor", recipe = { {"", "", ""}, - {"", "technic:machine_casing", copper_ingredient}, + {"", "technic:machine_casing", technic.compat.copper_ingredient}, {"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"} } }) @@ -28,7 +28,7 @@ minetest.register_node("technic:power_monitor",{ paramtype2 = "facedir", groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1, technic_machine=1}, connect_sides = {"bottom", "back"}, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Power Monitor")) diff --git a/technic/machines/register/battery_box.lua b/technic/machines/register/battery_box.lua index b271550..2594844 100644 --- a/technic/machines/register/battery_box.lua +++ b/technic/machines/register/battery_box.lua @@ -17,9 +17,9 @@ technic.register_power_tool("technic:blue_energy_crystal", 450000) minetest.register_craft({ output = "technic:battery", recipe = { - {"group:wood", copper_ingredient, "group:wood"}, + {"group:wood", technic.compat.copper_ingredient, "group:wood"}, {"group:wood", "default:tin_ingot", "group:wood"}, - {"group:wood", copper_ingredient, "group:wood"}, + {"group:wood", technic.compat.copper_ingredient, "group:wood"}, } }) -- Sulfur-lead-water recipes: @@ -300,7 +300,7 @@ function technic.register_battery_box(data) connect_sides = {"bottom"}, tube = data.tube and tube or nil, paramtype2 = "facedir", - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, drop = "technic:"..ltier.."_battery_box0", on_construct = function(pos) local meta = minetest.get_meta(pos) diff --git a/technic/machines/register/cables.lua b/technic/machines/register/cables.lua index 0197648..ed3dfce 100644 --- a/technic/machines/register/cables.lua +++ b/technic/machines/register/cables.lua @@ -161,7 +161,7 @@ function technic.register_cable(tier, size) inventory_image = "technic_"..ltier.."_cable_wield.png", wield_image = "technic_"..ltier.."_cable_wield.png", groups = groups, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, drop = "technic:"..ltier.."_cable", paramtype = "light", sunlight_propagates = true, @@ -203,7 +203,7 @@ function technic.register_cable(tier, size) description = S("%s Cable Plate"):format(tier), tiles = {"technic_"..ltier.."_cable.png"}, groups = table.copy(groups), - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, drop = "technic:"..ltier.."_cable_plate_1", paramtype = "light", sunlight_propagates = true, diff --git a/technic/machines/register/common.lua b/technic/machines/register/common.lua index 389996e..4bb5178 100644 --- a/technic/machines/register/common.lua +++ b/technic/machines/register/common.lua @@ -35,7 +35,7 @@ end -- handles the machine upgrades when set or removed local function on_machine_upgrade(meta, stack) local stack_name = stack:get_name() - if stack_name == chest_ingredient then + if stack_name == technic.compat.chest_ingredient then meta:set_int("public", 1) return 1 elseif stack_name ~= "technic:control_logic_unit" @@ -47,7 +47,7 @@ end -- something is about to be removed local function on_machine_downgrade(meta, stack, list) - if stack:get_name() == chest_ingredient then + if stack:get_name() == technic.compat.chest_ingredient then local inv = meta:get_inventory() local upg1, upg2 = inv:get_stack("upgrade1", 1), inv:get_stack("upgrade2", 1) diff --git a/technic/machines/register/generator.lua b/technic/machines/register/generator.lua index 8644c3e..af2ff64 100644 --- a/technic/machines/register/generator.lua +++ b/technic/machines/register/generator.lua @@ -125,7 +125,7 @@ function technic.register_generator(data) groups = groups, connect_sides = {"bottom", "back", "left", "right"}, legacy_facedir_simple = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, tube = data.tube and tube or nil, on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -192,7 +192,7 @@ function technic.register_generator(data) groups = active_groups, connect_sides = {"bottom"}, legacy_facedir_simple = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, tube = data.tube and tube or nil, drop = "technic:"..ltier.."_generator", can_dig = technic.machine_can_dig, diff --git a/technic/machines/register/grinder_recipes.lua b/technic/machines/register/grinder_recipes.lua index 28a1c4a..2017aef 100644 --- a/technic/machines/register/grinder_recipes.lua +++ b/technic/machines/register/grinder_recipes.lua @@ -82,15 +82,15 @@ 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", copper_ingredient) +register_dust("Copper", technic.compat.copper_ingredient) register_dust("Lead", "technic:lead_ingot") -register_dust("Gold", gold_ingot_ingredient) +register_dust("Gold", technic.compat.gold_ingot_ingredient) 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", tin_ingredient) +register_dust("Tin", technic.compat.tin_ingredient) 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 diff --git a/technic/machines/register/machine_base.lua b/technic/machines/register/machine_base.lua index 01d588c..f8a1528 100644 --- a/technic/machines/register/machine_base.lua +++ b/technic/machines/register/machine_base.lua @@ -174,7 +174,7 @@ function technic.register_base_machine(data) tube = data.tube and tube or nil, connect_sides = data.connect_sides or connect_default, legacy_facedir_simple = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, on_construct = function(pos) local node = minetest.get_node(pos) local meta = minetest.get_meta(pos) @@ -245,7 +245,7 @@ function technic.register_base_machine(data) groups = active_groups, connect_sides = data.connect_sides or connect_default, legacy_facedir_simple = true, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, tube = data.tube and tube or nil, can_dig = technic.machine_can_dig, allow_metadata_inventory_put = technic.machine_inventory_put, diff --git a/technic/machines/register/solar_array.lua b/technic/machines/register/solar_array.lua index 601ffc2..0d007ad 100644 --- a/technic/machines/register/solar_array.lua +++ b/technic/machines/register/solar_array.lua @@ -45,7 +45,7 @@ function technic.register_solar_array(data) "technic_"..ltier.."_solar_array_side.png", "technic_"..ltier.."_solar_array_side.png"}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, ["technic_"..ltier]=1}, connect_sides = {"bottom"}, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, description = S("Arrayed Solar %s Generator"):format(tier), active = false, drawtype = "nodebox", diff --git a/technic/machines/supply_converter.lua b/technic/machines/supply_converter.lua index 99bc570..31e5411 100644 --- a/technic/machines/supply_converter.lua +++ b/technic/machines/supply_converter.lua @@ -200,7 +200,7 @@ minetest.register_node("technic:supply_converter", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_all_tiers=1}, connect_sides = {"top", "bottom"}, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, on_receive_fields = supply_converter_receive_fields, on_construct = function(pos) local meta = minetest.get_meta(pos) diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua index ef1c01b..a792955 100644 --- a/technic/machines/switching_station.lua +++ b/technic/machines/switching_station.lua @@ -15,7 +15,7 @@ minetest.register_craft({ output = "technic:switching_station", recipe = { {"", "technic:lv_transformer", ""}, - {copper_ingredient, "technic:machine_casing", copper_ingredient}, + {technic.compat.copper_ingredient, "technic:machine_casing", technic.compat.copper_ingredient}, {"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"} } }) @@ -38,7 +38,7 @@ minetest.register_node("technic:switching_station",{ "technic_water_mill_top_active.png"}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1}, connect_sides = {"bottom"}, - sounds = wood_sounds, + sounds = technic.compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Switching Station")) diff --git a/technic/mcl_craftguide.lua b/technic/mcl_craftguide.lua index b652908..d9da5d4 100644 --- a/technic/mcl_craftguide.lua +++ b/technic/mcl_craftguide.lua @@ -34,74 +34,74 @@ centrifuge_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", sand_ingredient, "technic:uranium3_dust" }, - { dirt_ingredient.." 4", sand_ingredient, gravel_ingredient, "default:clay_lump 2" }, + { "technic:chernobylite_dust", technic.compat.sand_ingredient, "technic:uranium3_dust" }, + { technic.compat.dirt_ingredient.." 4", technic.compat.sand_ingredient, technic.compat.gravel_ingredient, "default:clay_lump 2" }, } compressor_recipes = { - {snow_block_ingredient, ice_block_ingredient}, - {sand_ingredient.." 2", sandstone_ingredient}, - {desert_sand_ingredient.." 2", desert_stone_ingredient}, - {desert_sand_ingredient, desert_stone_ingredient}, + {technic.compat.snow_block_ingredient, technic.compat.ice_block_ingredient}, + {technic.compat.sand_ingredient.." 2", technic.compat.sandstone_ingredient}, + {technic.compat.desert_sand_ingredient.." 2", technic.compat.desert_stone_ingredient}, + {technic.compat.desert_sand_ingredient, technic.compat.desert_stone_ingredient}, {"technic:mixed_metal_ingot", "technic:composite_plate"}, - {copper_ingredient.." 5", "technic:copper_plate"}, + {technic.compat.copper_ingredient.." 5", "technic:copper_plate"}, {"technic:coal_dust 4", "technic:graphite"}, {"technic:carbon_cloth", "technic:carbon_plate"}, {"technic:uranium35_ingot 5", "technic:uranium_fuel"}, } extractor_recipes = { - {"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 ""}, + {"technic:coal_dust", technic.compat.dye_black .. " 2"}, + {technic.compat.blueberries_ingredient, technic.compat.dye_violet .. " 2"}, + {technic.compat.grass_ingredient, technic.compat.dye_green .. " 1"}, + {technic.compat.dry_shrub_ingredient, technic.compat.dye_brown .. " 1"}, + {technic.compat.junglegrass_ingredient, technic.compat.dye_green .. " 2"}, + {technic.compat.cactus_ingredient, technic.compat.dye_green .. " 4"}, + {technic.compat.geranium_ingredient, technic.compat.dye_blue .. " 4"}, + {technic.compat.dandelion_white_ingredient, technic.compat.dye_white .. " 4"}, + {technic.compat.dandelion_yellow_ingredient, technic.compat.dye_yellow .. " 4"}, + {technic.compat.tulip_ingredient, technic.compat.dye_orange .. " 4"}, + {technic.compat.rose_ingredient, technic.compat.dye_red .. " 4"}, + {technic.compat.viola_ingredient, technic.compat.dye_violet .. " 4"}, + {technic.compat.blackberry_ingredient, unifieddyes and "unifieddyes:magenta_s50 4" or technic.compat.dye_violet .. " 4"}, + {technic.compat.blueberry_ingredient, unifieddyes and "unifieddyes:magenta_s50 4" or ""}, } freezer_recipes = { - {water_bucket_ingredient, { ice_block_ingredient, emtpy_bucket_ingredient } }, - {bucket_river_water_ingredient, { ice_block_ingredient, emtpy_bucket_ingredient } }, - {dirt_ingredient , dirt_with_snow_ingredient }, - {bucket_lava_ingredient, { obsidian_ingredient, emtpy_bucket_ingredient } } + {technic.compat.water_bucket_ingredient, { technic.compat.ice_block_ingredient, technic.compat.emtpy_bucket_ingredient } }, + {technic.compat.bucket_river_water_ingredient, { technic.compat.ice_block_ingredient, technic.compat.emtpy_bucket_ingredient } }, + {technic.compat.dirt_ingredient , technic.compat.dirt_with_snow_ingredient }, + {technic.compat.bucket_lava_ingredient, { technic.compat.obsidian_ingredient, technic.compat.emtpy_bucket_ingredient } } } grinder_recipes = { -- Dusts - {coal_ingredient, "technic:coal_dust 2"}, - {copper_lump_ingredient, "technic:copper_dust 2"}, - {desert_stone_ingredient, desert_sand_ingredient}, - {gold_lump_ingredient, "technic:gold_dust 2"}, - {iron_lump_ingredient, "technic:wrought_iron_dust 2"}, + {technic.compat.coal_ingredient, "technic:coal_dust 2"}, + {technic.compat.copper_lump_ingredient, "technic:copper_dust 2"}, + {technic.compat.desert_stone_ingredient, technic.compat.desert_sand_ingredient}, + {technic.compat.gold_lump_ingredient, "technic:gold_dust 2"}, + {technic.compat.iron_lump_ingredient, "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_ingredient, "technic:stone_dust"}, - {sand_ingredient, "technic:stone_dust"}, - {desert_sand_ingredient, "technic:stone_dust"}, + {technic.compat.stone_ingredient, "technic:stone_dust"}, + {technic.compat.sand_ingredient, "technic:stone_dust"}, + {technic.compat.desert_sand_ingredient, "technic:stone_dust"}, -- Other - {cobble_ingredient, gravel_ingredient}, - {gravel_ingredient, sand_ingredient}, - {sandstone_ingredient, sand_ingredient.." 2"}, -- reverse recipe can be found in the compressor - {desert_stone_ingredient, desert_sand_ingredient.." 2"}, -- reverse recipe can be found in the compressor - {ice_block_ingredient, snow_block_ingredient}, + {technic.compat.cobble_ingredient, technic.compat.gravel_ingredient}, + {technic.compat.gravel_ingredient, technic.compat.sand_ingredient}, + {technic.compat.sandstone_ingredient, technic.compat.sand_ingredient.." 2"}, -- reverse recipe can be found in the compressor + {technic.compat.desert_stone_ingredient, technic.compat.desert_sand_ingredient.." 2"}, -- reverse recipe can be found in the compressor + {technic.compat.ice_block_ingredient, technic.compat.snow_block_ingredient}, } alloy_recipes = { {"technic:copper_dust 7", "technic:tin_dust", "technic:bronze_dust 8", 12}, - {copper_ingredient.." 7", tin_ingredient, bronze_ingredient.." 8", 12}, + {technic.compat.copper_ingredient.." 7", technic.compat.tin_ingredient, technic.compat.bronze_ingredient.." 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}, @@ -109,14 +109,14 @@ alloy_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_ingredient.." 2", "technic:zinc_ingot", "basic_materials:brass_ingot 3"}, - {sand_ingredient.." 2", "technic:coal_dust 2", "technic:silicon_wafer"}, + {technic.compat.copper_ingredient.." 2", "technic:zinc_ingot", "basic_materials:brass_ingot 3"}, + {technic.compat.sand_ingredient.." 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}, - {ice_block_ingredient, emtpy_bucket_ingredient, water_bucket_ingredient, 1 }, + {technic.compat.ice_block_ingredient, technic.compat.emtpy_bucket_ingredient, technic.compat.water_bucket_ingredient, 1 }, } for _, data in pairs(alloy_recipes) do diff --git a/technic/mcl_support.lua b/technic/mcl_support.lua index cd1638e..274176e 100644 --- a/technic/mcl_support.lua +++ b/technic/mcl_support.lua @@ -2,7 +2,6 @@ local default = minetest.get_modpath("default") and default or {} local mcl = minetest.get_modpath("mcl_core") -- Compatibility table -local technic = {} technic.compat = {} -- Helper function to set compatibility variables @@ -11,101 +10,101 @@ local function set_compat(mcl_value, default_value) end -- Mineclone2 Support -stone_sounds = mcl_core_modpath and mcl_sounds.node_sound_stone_defaults() or default.node_sound_stone_defaults() -mt_light_max = mcl_core_modpath and mcl_core.LIGHT_MAX or default.LIGHT_MAX -copper_ingredient = mcl_core_modpath and "mcl_copper:copper_ingot" or 'default:copper_ingot' -iron_ingredient = mcl_core_modpath and "mcl_core:iron_ingot" or 'default:steel_ingot' -iron_lump_ingredient = mcl_core_modpath and "mcl_raw_ores:raw_iron" or 'default:iron_lump' -gold_lump_ingredient = mcl_core_modpath and "mcl_raw_ores:raw_gold" or 'default:gold_lump' -copper_lump_ingredient = mcl_core_modpath and "mcl_copper:raw_copper" or 'default:copper_lump' -mese_crystal_ingredient = mcl_core_modpath and "mesecons:wire_00000000_off" or 'default:mese_crystal' -diamond_ingredient = mcl_core_modpath and "mcl_core:diamond" or 'default:diamond' -glass_ingredient = mcl_core_modpath and "mcl_core:glass" or 'default:glass' -brick_block_ingredient = mcl_core_modpath and "mcl_core:brick_block" or 'default:brick' -mese_block_ingredient = mcl_core_modpath and "mesecons_torch:redstoneblock" or "default:mese" -paper_ingredient = mcl_core_modpath and "mcl_core:paper" or 'default:paper' -obsidian_glass_ingredient = mcl_core_modpath and "mcl_core:obsidian" or 'default:obsidian_glass' -obsidian_ingredient = mcl_core_modpath and "mcl_core:obsidian" or 'default:obsidian' -green_dye_ingredient = mcl_core_modpath and "mcl_dye:green" or 'dye:green' -blue_dye_ingredient = mcl_core_modpath and "mcl_dye:blue" or 'dye:blue' -red_dye_ingredient = mcl_core_modpath and "mcl_dye:red" or 'dye:red' -white_dye_ingredient = mcl_core_modpath and "mcl_dye:white" or 'dye:white' -gold_ingot_ingredient = mcl_core_modpath and "mcl_core:gold_ingot" or 'default:gold_ingot' -chest_ingredient = mcl_core_modpath and "mcl_chests:chest" or "default:chest" -stone_ingredient = mcl_core_modpath and "mcl_core:stone" or "default:stone" -wood_fence_ingredient = mcl_core_modpath and "group:fence_wood" or "default:fence_wood" -diamond_ingredient = mcl_core_modpath and "mcl_core:diamond" or "default:diamond" -bronze_ingredient = mcl_core_modpath and "mcl_copper:copper_ingot" or 'default:bronze_ingot' -tin_ingredient = mcl_core_modpath and "moreores:tin_ingot" or 'default:tin_ingot' -sandstone_ingredient = mcl_core_modpath and "mcl_core:sandstone" or 'default:desert_stone' -sand_ingredient = mcl_core_modpath and "mcl_core:sand" or 'default:sand' -gravel_ingredient = mcl_core_modpath and "mcl_core:gravel" or 'default:gravel' -desert_stone_ingredient = mcl_core_modpath and "mcl_core:redsandstone" or 'default:desert_stone' -desert_sand_ingredient = mcl_core_modpath and "mcl_core:redsand" or 'default:desert_sand' -furnace_ingredient = mcl_core_modpath and "mcl_furnaces:furnace" or 'default:furnace' -mossy_cobble_ingredient = mcl_core_modpath and "mcl_core:mossycobble" or 'default:mossycobble' -cobble_ingredient = mcl_core_modpath and "mcl_core:cobble" or 'default:cobble' -snow_block_ingredient = mcl_core_modpath and "mcl_core:snowblock" or 'default:snowblock' -ice_block_ingredient = mcl_core_modpath and "mcl_core:ice" or 'default:ice' -granite_ingredient = mcl_core_modpath and "mcl_core:granite" or 'technic:granite' -granite_bricks_ingredient = mcl_core_modpath and "mcl_core:granite_smooth" or 'technic:granite_bricks' -coal_ingredient = mcl_core_modpath and "group:coal" or "default:coal_lump" -dirt_ingredient = mcl_core_modpath and "mcl_core:dirt" or "default:dirt" -mesecons_fiber_ingredient = mcl_core_modpath and "mesecons:wire_00000000_off" or "mesecons_materials:fiber" -stick_ingredient = mcl_core_modpath and "mcl_core:stick" or "default:stick" -emtpy_bucket_ingredient = mcl_core_modpath and "mcl_buckets:bucket_empty" or "bucket:bucket_empty" -water_bucket_ingredient = mcl_core_modpath and "mcl_buckets:bucket_water" or "bucket:bucket_water" +technic.compat.stone_sounds = mcl and mcl_sounds.node_sound_stone_defaults() or default.node_sound_stone_defaults() +technic.compat.mt_light_max = mcl and mcl_core.LIGHT_MAX or default.LIGHT_MAX +technic.compat.copper_ingredient = mcl and "mcl_copper:copper_ingot" or 'default:copper_ingot' +technic.compat.iron_ingredient = mcl and "mcl_core:iron_ingot" or 'default:steel_ingot' +technic.compat.iron_lump_ingredient = mcl and "mcl_raw_ores:raw_iron" or 'default:iron_lump' +technic.compat.gold_lump_ingredient = mcl and "mcl_raw_ores:raw_gold" or 'default:gold_lump' +technic.compat.copper_lump_ingredient = mcl and "mcl_copper:raw_copper" or 'default:copper_lump' +technic.compat.mese_crystal_ingredient = mcl and "mesecons:wire_00000000_off" or 'default:mese_crystal' +technic.compat.diamond_ingredient = mcl and "mcl_core:diamond" or 'default:diamond' +technic.compat.glass_ingredient = mcl and "mcl_core:glass" or 'default:glass' +technic.compat.brick_block_ingredient = mcl and "mcl_core:brick_block" or 'default:brick' +technic.compat.mese_block_ingredient = mcl and "mesecons_torch:redstoneblock" or "default:mese" +technic.compat.paper_ingredient = mcl and "mcl_core:paper" or 'default:paper' +technic.compat.obsidian_glass_ingredient = mcl and "mcl_core:obsidian" or 'default:obsidian_glass' +technic.compat.obsidian_ingredient = mcl and "mcl_core:obsidian" or 'default:obsidian' +technic.compat.green_dye_ingredient = mcl and "mcl_dye:green" or 'dye:green' +technic.compat.blue_dye_ingredient = mcl and "mcl_dye:blue" or 'dye:blue' +technic.compat.red_dye_ingredient = mcl and "mcl_dye:red" or 'dye:red' +technic.compat.white_dye_ingredient = mcl and "mcl_dye:white" or 'dye:white' +technic.compat.gold_ingot_ingredient = mcl and "mcl_core:gold_ingot" or 'default:gold_ingot' +technic.compat.chest_ingredient = mcl and "mcl_chests:chest" or "default:chest" +technic.compat.stone_ingredient = mcl and "mcl_core:stone" or "default:stone" +technic.compat.wood_fence_ingredient = mcl and "group:fence_wood" or "default:fence_wood" +technic.compat.diamond_ingredient = mcl and "mcl_core:diamond" or "default:diamond" +technic.compat.bronze_ingredient = mcl and "mcl_copper:copper_ingot" or 'default:bronze_ingot' +technic.compat.tin_ingredient = mcl and "moreores:tin_ingot" or 'default:tin_ingot' +technic.compat.sandstone_ingredient = mcl and "mcl_core:sandstone" or 'default:desert_stone' +technic.compat.sand_ingredient = mcl and "mcl_core:sand" or 'default:sand' +technic.compat.gravel_ingredient = mcl and "mcl_core:gravel" or 'default:gravel' +technic.compat.desert_stone_ingredient = mcl and "mcl_core:redsandstone" or 'default:desert_stone' +technic.compat.desert_sand_ingredient = mcl and "mcl_core:redsand" or 'default:desert_sand' +technic.compat.furnace_ingredient = mcl and "mcl_furnaces:furnace" or 'default:furnace' +technic.compat.mossy_cobble_ingredient = mcl and "mcl_core:mossycobble" or 'default:mossycobble' +technic.compat.cobble_ingredient = mcl and "mcl_core:cobble" or 'default:cobble' +technic.compat.snow_block_ingredient = mcl and "mcl_core:snowblock" or 'default:snowblock' +technic.compat.ice_block_ingredient = mcl and "mcl_core:ice" or 'default:ice' +technic.compat.granite_ingredient = mcl and "mcl_core:granite" or 'technic:granite' +technic.compat.granite_bricks_ingredient = mcl and "mcl_core:granite_smooth" or 'technic:granite_bricks' +technic.compat.coal_ingredient = mcl and "group:coal" or "default:coal_lump" +technic.compat.dirt_ingredient = mcl and "mcl_core:dirt" or "default:dirt" +technic.compat.mesecons_fiber_ingredient = mcl and "mesecons:wire_00000000_off" or "mesecons_materials:fiber" +technic.compat.stick_ingredient = mcl and "mcl_core:stick" or "default:stick" +technic.compat.emtpy_bucket_ingredient = mcl and "mcl_buckets:bucket_empty" or "bucket:bucket_empty" +technic.compat.water_bucket_ingredient = mcl and "mcl_buckets:bucket_water" or "bucket:bucket_water" -- Ingredient Variables -if mcl_core_modpath then - blueberries_ingredient = "mcl_farming:blueberries" - grass_ingredient = "mcl_core:grass" - dry_shrub_ingredient = "mcl_core:deadbush" - junglegrass_ingredient = "mcl_core:tallgrass" - 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" - rose_ingredient = "mcl_flowers:poppy" - viola_ingredient = "mcl_flowers:allium" +if mcl then + technic.compat.blueberries_ingredient = "mcl_farming:blueberries" + technic.compat.grass_ingredient = "mcl_core:grass" + technic.compat.dry_shrub_ingredient = "mcl_core:deadbush" + technic.compat.junglegrass_ingredient = "mcl_core:tallgrass" + technic.compat.cactus_ingredient = "mcl_core:cactus" + technic.compat.geranium_ingredient = "mcl_flowers:blue_orchid" + technic.compat.dandelion_white_ingredient = "mcl_flowers:oxeye_daisy" + technic.compat.dandelion_yellow_ingredient = "mcl_flowers:dandelion" + technic.compat.tulip_ingredient = "mcl_flowers:orange_tulip" + technic.compat.rose_ingredient = "mcl_flowers:poppy" + technic.compat.viola_ingredient = "mcl_flowers:allium" else - 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" + technic.compat.blueberries_ingredient = "default:blueberries" + technic.compat.grass_ingredient = "default:grass_1" + technic.compat.dry_shrub_ingredient = "default:dry_shrub" + technic.compat.junglegrass_ingredient = "default:junglegrass" + technic.compat.cactus_ingredient = "default:cactus" + technic.compat.geranium_ingredient = "flowers:geranium" + technic.compat.dandelion_white_ingredient = "flowers:dandelion_white" + technic.compat.dandelion_yellow_ingredient = "flowers:dandelion_yellow" + technic.compat.tulip_ingredient = "flowers:tulip" + technic.compat.rose_ingredient = "flowers:rose" + technic.compat.viola_ingredient = "flowers:viola" end -- Dye Output Variables -if mcl_core_modpath then - 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" +if mcl then + technic.compat.dye_black = "mcl_dye:black" + technic.compat.dye_violet = "mcl_dye:violet" + technic.compat.dye_green = "mcl_dye:green" + technic.compat.dye_brown = "mcl_dye:brown" + technic.compat.dye_blue = "mcl_dye:blue" + technic.compat.dye_white = "mcl_dye:white" + technic.compat.dye_yellow = "mcl_dye:yellow" + technic.compat.dye_orange = "mcl_dye:orange" + technic.compat.dye_red = "mcl_dye:red" else - 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" + technic.compat.dye_black = "dye:black" + technic.compat.dye_violet = "dye:violet" + technic.compat.dye_green = "dye:green" + technic.compat.dye_brown = "dye:brown" + technic.compat.dye_blue = "dye:blue" + technic.compat.dye_white = "dye:white" + technic.compat.dye_yellow = "dye:yellow" + technic.compat.dye_orange = "dye:orange" + technic.compat.dye_red = "dye:red" end -dirt_with_snow_ingredient = mcl_core_modpath and "mcl_core:dirt_with_grass_snow" or "default:dirt_with_snow" -bucket_lava_ingredient = mcl_core_modpath and "mcl_buckets:bucket_lava" or "bucket:bucket_lava" -bucket_river_water_ingredient = mcl_core_modpath and "mcl_buckets:bucket_river_water" or "bucket:bucket_river_water" +technic.compat.dirt_with_snow_ingredient = mcl and "mcl_core:dirt_with_grass_snow" or "default:dirt_with_snow" +technic.compat.bucket_lava_ingredient = mcl and "mcl_buckets:bucket_lava" or "bucket:bucket_lava" +technic.compat.bucket_river_water_ingredient = mcl and "mcl_buckets:bucket_river_water" or "bucket:bucket_river_water" diff --git a/technic/radiation.lua b/technic/radiation.lua index d0cdb59..814be14 100644 --- a/technic/radiation.lua +++ b/technic/radiation.lua @@ -52,7 +52,7 @@ local rad_resistance_node = { ["default:ice"] = 5.6, ["default:lava_flowing"] = 8.5, ["default:lava_source"] = 17, - [mese_block_ingredient] = 21, + [technic.compat.mese_block_ingredient] = 21, ["default:mossycobble"] = 15, ["default:tinblock"] = 37, ["pbj_pup:pbj_pup"] = 10000, @@ -64,7 +64,7 @@ local rad_resistance_node = { ["nyancat:nyancat"] = 10000, ["nyancat:nyancat_rainbow"] = 10000, ["default:obsidian"] = 18, - [obsidian_glass_ingredient] = 18, + [technic.compat.obsidian_glass_ingredient] = 18, ["default:sand"] = 10, ["default:sandstone"] = 15, ["default:sandstonebrick"] = 15, @@ -153,7 +153,7 @@ local rad_resistance_node = { ["technic:chromium_block"] = 37, ["technic:corium_flowing"] = 40, ["technic:corium_source"] = 80, - [granite_ingredient] = 18, + [technic.compat.granite_ingredient] = 18, ["technic:lead_block"] = 80, ["technic:marble"] = 18, ["technic:marble_bricks"] = 18, @@ -457,7 +457,7 @@ minetest.register_node("technic:chernobylite_block", { tiles = {"technic_chernobylite_block.png"}, is_ground_content = true, groups = {cracky=1, radioactive=4, level=2}, - sounds = stone_sounds, + sounds = technic.compat.stone_sounds, light_source = 2, }) diff --git a/technic/tools/cans.lua b/technic/tools/cans.lua index aa6b161..ef7f029 100644 --- a/technic/tools/cans.lua +++ b/technic/tools/cans.lua @@ -135,7 +135,7 @@ minetest.register_craft({ output = 'technic:river_water_can 1', recipe = { {'technic:zinc_ingot', 'technic:rubber', 'technic:zinc_ingot'}, - {iron_ingredient, '', iron_ingredient}, - {'technic:zinc_ingot', iron_ingredient, 'technic:zinc_ingot'}, + {technic.compat.iron_ingredient, '', technic.compat.iron_ingredient}, + {'technic:zinc_ingot', technic.compat.iron_ingredient, 'technic:zinc_ingot'}, } }) diff --git a/technic/tools/mining_drill.lua b/technic/tools/mining_drill.lua index fec7b93..e102e8f 100644 --- a/technic/tools/mining_drill.lua +++ b/technic/tools/mining_drill.lua @@ -6,9 +6,9 @@ local S = technic.getter minetest.register_craft({ output = 'technic:mining_drill', recipe = { - {tin_ingredient, 'technic:diamond_drill_head', tin_ingredient}, + {technic.compat.tin_ingredient, 'technic:diamond_drill_head', technic.compat.tin_ingredient}, {'technic:stainless_steel_ingot', 'basic_materials:motor', 'technic:stainless_steel_ingot'}, - {'', 'technic:red_energy_crystal', copper_ingredient}, + {'', 'technic:red_energy_crystal', technic.compat.copper_ingredient}, } }) minetest.register_craft({ diff --git a/technic/tools/mining_lasers.lua b/technic/tools/mining_lasers.lua index f3db2c1..596c8b6 100644 --- a/technic/tools/mining_lasers.lua +++ b/technic/tools/mining_lasers.lua @@ -11,25 +11,25 @@ local S = technic.getter minetest.register_craft({ output = "technic:laser_mk1", recipe = { - {diamond_ingredient, "basic_materials:brass_ingot", obsidian_glass_ingredient}, + {technic.compat.diamond_ingredient, "basic_materials:brass_ingot", technic.compat.obsidian_glass_ingredient}, {"","basic_materials:brass_ingot", "technic:red_energy_crystal"}, - {"", "", copper_ingredient}, + {"", "", technic.compat.copper_ingredient}, } }) minetest.register_craft({ output = "technic:laser_mk2", recipe = { - {diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk1"}, + {technic.compat.diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk1"}, {"", "technic:carbon_steel_ingot", "technic:green_energy_crystal"}, - {"", "", copper_ingredient}, + {"", "", technic.compat.copper_ingredient}, } }) minetest.register_craft({ output = "technic:laser_mk3", recipe = { - {diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk2"}, + {technic.compat.diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk2"}, {"", "technic:carbon_steel_ingot", "technic:blue_energy_crystal"}, - {"", "", copper_ingredient}, + {"", "", technic.compat.copper_ingredient}, } }) diff --git a/technic/tools/sonic_screwdriver.lua b/technic/tools/sonic_screwdriver.lua index 2044e5b..024f78a 100644 --- a/technic/tools/sonic_screwdriver.lua +++ b/technic/tools/sonic_screwdriver.lua @@ -90,9 +90,9 @@ minetest.register_tool("technic:sonic_screwdriver", { minetest.register_craft({ output = "technic:sonic_screwdriver", recipe = { - {"", diamond_ingredient, ""}, - {mesecons_fiber_ingredient, "technic:battery", mesecons_fiber_ingredient}, - {mesecons_fiber_ingredient, "moreores:mithril_ingot", mesecons_fiber_ingredient} + {"", technic.compat.diamond_ingredient, ""}, + {technic.compat.mesecons_fiber_ingredient, "technic:battery", technic.compat.mesecons_fiber_ingredient}, + {technic.compat.mesecons_fiber_ingredient, "moreores:mithril_ingot", technic.compat.mesecons_fiber_ingredient} } }) diff --git a/technic/tools/tree_tap.lua b/technic/tools/tree_tap.lua index 8926aa5..82e7872 100644 --- a/technic/tools/tree_tap.lua +++ b/technic/tools/tree_tap.lua @@ -38,8 +38,8 @@ minetest.register_tool("technic:treetap", { minetest.register_craft({ output = "technic:treetap", recipe = { - {"pipeworks:tube_1", "group:wood", stick_ingredient}, - {"", stick_ingredient, stick_ingredient} + {"pipeworks:tube_1", "group:wood", technic.compat.stick_ingredient}, + {"", technic.compat.stick_ingredient, technic.compat.stick_ingredient} }, }) diff --git a/technic_cnc/cnc.lua b/technic_cnc/cnc.lua index 841b50e..2c15d8c 100644 --- a/technic_cnc/cnc.lua +++ b/technic_cnc/cnc.lua @@ -19,9 +19,9 @@ if technic_cnc.use_technic then minetest.register_craft({ output = 'technic:cnc', recipe = { - {glass_ingredient, 'technic:diamond_drill_head', glass_ingredient}, - {'technic:control_logic_unit', 'technic:machine_casing', 'basic_materials:motor'}, - {'technic:carbon_steel_ingot', 'technic:lv_cable', 'technic:carbon_steel_ingot'}, + {technic_cnc.compat.glass_ingredient, 'technic:diamond_drill_head', technic_cnc.compat.glass_ingredient}, + {'technic:control_logic_unit', 'technic:machine_casing', 'basic_materials:motor'}, + {'technic:carbon_steel_ingot', 'technic:lv_cable', 'technic:carbon_steel_ingot'}, }, }) @@ -34,9 +34,9 @@ else minetest.register_craft({ output = 'technic:cnc', recipe = { - {glass_ingredient, diamond_ingredient, glass_ingredient}, - {'basic_materials:ic', 'default:steelblock', 'basic_materials:motor'}, - {'default:steel_ingot', mese_block_ingredient, 'default:steel_ingot'}, + {technic_cnc.compat.glass_ingredient, technic_cnc.compat.diamond_ingredient, technic_cnc.compat.glass_ingredient}, + {'basic_materials:ic', 'default:steelblock', 'basic_materials:motor'}, + {'default:steel_ingot', technic_cnc.compat.mese_block_ingredient, 'default:steel_ingot'}, }, }) diff --git a/technic_cnc/init.lua b/technic_cnc/init.lua index 84861d3..9a9358b 100644 --- a/technic_cnc/init.lua +++ b/technic_cnc/init.lua @@ -7,6 +7,14 @@ technic_cnc.technic_modpath = minetest.get_modpath("technic") technic_cnc.use_technic = technic_cnc.technic_modpath and minetest.settings:get_bool("technic_cnc_use_technic") ~= false +local mcl = minetest.get_modpath("mcl_core") + +-- Compatibility table +technic_cnc.compat = {} +technic_cnc.compat.glass_ingredient = mcl and "mcl_core:glass" or 'default:glass' +technic_cnc.compat.mese_block_ingredient = mcl and "mesecons_torch:redstoneblock" or "default:mese" +technic_cnc.compat.diamond_ingredient = mcl and "mcl_core:diamond" or "default:diamond" + if rawget(_G, "intllib") then technic_cnc.getter = intllib.Getter() else From 9a231387a3ac0cc5ee05e15bcfffae6019c00c51 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Thu, 28 Dec 2023 08:47:46 +0000 Subject: [PATCH 20/32] Made nodes breakable again --- technic/machines/HV/forcefield.lua | 12 +++++- technic/machines/HV/nuclear_reactor.lua | 12 +++++- technic/machines/HV/quarry.lua | 8 +++- technic/machines/LV/geothermal.lua | 12 +++++- technic/machines/LV/lamp.lua | 20 ++++++++-- technic/machines/LV/led.lua | 12 +++++- technic/machines/LV/music_player.lua | 6 ++- technic/machines/LV/solar_panel.lua | 6 ++- technic/machines/LV/water_mill.lua | 12 +++++- technic/machines/MV/hydro_turbine.lua | 12 +++++- technic/machines/MV/power_radiator.lua | 8 +++- technic/machines/MV/tool_workshop.lua | 8 +++- technic/machines/MV/wind_mill.lua | 12 +++++- technic/machines/other/anchor.lua | 6 ++- technic/machines/other/coal_alloy_furnace.lua | 12 +++++- technic/machines/other/constructor.lua | 16 ++++++-- technic/machines/other/frames.lua | 39 ++++++++++++++----- technic/machines/other/injector.lua | 7 +++- technic/machines/power_monitor.lua | 6 ++- technic/machines/register/battery_box.lua | 5 ++- technic/machines/register/cables.lua | 3 ++ technic/machines/register/generator.lua | 10 ++++- technic/machines/register/machine_base.lua | 10 ++++- technic/machines/register/solar_array.lua | 5 ++- technic/machines/supply_converter.lua | 6 ++- technic/machines/switching_station.lua | 2 +- technic/tools/flashlight.lua | 5 ++- technic_chests/register.lua | 5 +++ technic_cnc/cnc.lua | 10 ++++- technic_cnc/cnc_api.lua | 8 +++- technic_worldgen/rubber.lua | 33 +++++++++++++--- 31 files changed, 263 insertions(+), 65 deletions(-) diff --git a/technic/machines/HV/forcefield.lua b/technic/machines/HV/forcefield.lua index c7dfc1c..72ada04 100644 --- a/technic/machines/HV/forcefield.lua +++ b/technic/machines/HV/forcefield.lua @@ -295,7 +295,7 @@ minetest.register_node("technic:forcefield_emitter_off", { "technic_forcefield_emitter_off.png", "technic_forcefield_emitter_off.png" }, - groups = {cracky = 1, technic_machine = 1, technic_hv = 1}, + groups = {cracky = 1, technic_machine = 1, technic_hv = 1,pickaxey=3}, on_receive_fields = forcefield_receive_fields, on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -314,6 +314,10 @@ minetest.register_node("technic:forcefield_emitter_off", { mesecons = mesecons, digiline = digiline_def, technic_run = run, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node("technic:forcefield_emitter_on", { @@ -327,7 +331,7 @@ minetest.register_node("technic:forcefield_emitter_on", { "technic_forcefield_emitter_on.png" }, groups = {cracky = 1, technic_machine = 1, technic_hv = 1, - not_in_creative_inventory=1}, + not_in_creative_inventory=1,pickaxey=3}, drop = "technic:forcefield_emitter_off", on_receive_fields = forcefield_receive_fields, on_destruct = function(pos) @@ -346,6 +350,10 @@ minetest.register_node("technic:forcefield_emitter_on", { minetest.dig_node(pos) return {"technic:forcefield_emitter_off"} end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node("technic:forcefield", { diff --git a/technic/machines/HV/nuclear_reactor.lua b/technic/machines/HV/nuclear_reactor.lua index 656b5d0..43ac769 100644 --- a/technic/machines/HV/nuclear_reactor.lua +++ b/technic/machines/HV/nuclear_reactor.lua @@ -412,7 +412,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core", { }, drawtype = "mesh", mesh = "technic_reactor.obj", - groups = {cracky = 1, technic_machine = 1, technic_hv = 1, digiline_remote_receive = 1}, + groups = {cracky = 1, technic_machine = 1, technic_hv = 1, digiline_remote_receive = 1,pickaxey=3}, legacy_facedir_simple = true, sounds = technic.compat.wood_sounds, paramtype = "light", @@ -437,6 +437,10 @@ minetest.register_node("technic:hv_nuclear_reactor_core", { allow_metadata_inventory_take = technic.machine_inventory_take, allow_metadata_inventory_move = technic.machine_inventory_move, technic_run = run, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node("technic:hv_nuclear_reactor_core_active", { @@ -447,7 +451,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core_active", { drawtype = "mesh", mesh = "technic_reactor.obj", groups = {cracky = 1, technic_machine = 1, technic_hv = 1, radioactive = 4, - not_in_creative_inventory = 1, digiline_remote_receive = 1}, + not_in_creative_inventory = 1, digiline_remote_receive = 1,pickaxey=3}, legacy_facedir_simple = true, sounds = technic.compat.wood_sounds, drop = "technic:hv_nuclear_reactor_core", @@ -487,6 +491,10 @@ minetest.register_node("technic:hv_nuclear_reactor_core_active", { meta:set_int("burn_time", burn_time + 1) return true end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) technic.register_machine("HV", "technic:hv_nuclear_reactor_core", technic.producer) diff --git a/technic/machines/HV/quarry.lua b/technic/machines/HV/quarry.lua index c1d3c2d..153a51e 100644 --- a/technic/machines/HV/quarry.lua +++ b/technic/machines/HV/quarry.lua @@ -246,7 +246,7 @@ minetest.register_node("technic:quarry", { "technic_carbon_steel_block.png"..cable_entry }, paramtype2 = "facedir", - groups = {cracky=2, tubedevice=1, technic_machine=1, technic_hv=1}, + groups = {cracky=2, tubedevice=1, technic_machine=1, technic_hv=1,pickaxey=3}, connect_sides = {"bottom", "front", "left", "right"}, tube = { connect_sides = {top = 1}, @@ -289,7 +289,11 @@ minetest.register_node("technic:quarry", { end, allow_metadata_inventory_take = function(pos, listname, index, stack, player) return send_move_error(player) - end + end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) technic.register_machine("HV", "technic:quarry", technic.receiver) diff --git a/technic/machines/LV/geothermal.lua b/technic/machines/LV/geothermal.lua index 1bc1cc7..823d250 100644 --- a/technic/machines/LV/geothermal.lua +++ b/technic/machines/LV/geothermal.lua @@ -87,7 +87,7 @@ minetest.register_node("technic:geothermal", { tiles = {"technic_geothermal_top.png", "technic_machine_bottom.png", "technic_geothermal_side.png", "technic_geothermal_side.png", "technic_geothermal_side.png", "technic_geothermal_side.png"}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, - technic_machine=1, technic_lv=1}, + technic_machine=1, technic_lv=1, pickaxey=3}, paramtype2 = "facedir", legacy_facedir_simple = true, sounds = technic.compat.wood_sounds, @@ -97,6 +97,10 @@ minetest.register_node("technic:geothermal", { meta:set_int("LV_EU_supply", 0) end, technic_run = run, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node("technic:geothermal_active", { @@ -105,11 +109,15 @@ minetest.register_node("technic:geothermal_active", { "technic_geothermal_side.png", "technic_geothermal_side.png", "technic_geothermal_side.png"}, paramtype2 = "facedir", groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, - technic_machine=1, technic_lv=1, not_in_creative_inventory=1}, + technic_machine=1, technic_lv=1, not_in_creative_inventory=1, pickaxey=3}, legacy_facedir_simple = true, sounds = technic.compat.wood_sounds, drop = "technic:geothermal", technic_run = run, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) technic.register_machine("LV", "technic:geothermal", technic.producer) diff --git a/technic/machines/LV/lamp.lua b/technic/machines/LV/lamp.lua index 72c2b65..1ef2bf4 100644 --- a/technic/machines/LV/lamp.lua +++ b/technic/machines/LV/lamp.lua @@ -26,7 +26,11 @@ minetest.register_node("technic:dummy_light_source", { diggable = false, pointable = false, --drop = "", -- Intentionally allowed to drop itself - groups = {not_in_creative_inventory = 1} + groups = {not_in_creative_inventory = 1, pickaxey=3}, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) @@ -109,12 +113,16 @@ local ndef ndef = { description = desc, - groups = {cracky = 2, technic_machine = 1, technic_lv = 1}, + groups = {cracky = 2, technic_machine = 1, technic_lv = 1, pickaxey=3}, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", desc) meta:set_int("LV_EU_demand", demand) - end + end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore } for k, v in pairs(common_fields) do @@ -129,11 +137,15 @@ ndef = { paramtype = "light", light_source = 14, drop = "technic:lv_lamp", - groups = {cracky = 2, technic_machine = 1, technic_lv = 1, not_in_creative_inventory = 1}, + groups = {cracky = 2, technic_machine = 1, technic_lv = 1, not_in_creative_inventory = 1, pickaxey=3}, technic_on_disable = function(pos) illuminate(pos, false) technic.swap_node(pos, "technic:lv_lamp") end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore } for k, v in pairs(common_fields) do diff --git a/technic/machines/LV/led.lua b/technic/machines/LV/led.lua index 3786ab7..b532dd2 100644 --- a/technic/machines/LV/led.lua +++ b/technic/machines/LV/led.lua @@ -48,13 +48,17 @@ ndef = { description = desc, inventory_image = "technic_lv_led_inv.png", sunlight_propagates = true, - groups = {cracky = 2, technic_machine = 1, technic_lv = 1}, + groups = {cracky = 2, technic_machine = 1, technic_lv = 1,pickaxey=3}, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", desc) meta:set_int("LV_EU_demand", demand) end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore } for k, v in pairs(common_fields) do @@ -69,10 +73,14 @@ ndef = { paramtype = "light", light_source = 9, drop = "technic:lv_led", - groups = {cracky = 2, technic_machine = 1, technic_lv = 1, not_in_creative_inventory = 1}, + groups = {cracky = 2, technic_machine = 1, technic_lv = 1, not_in_creative_inventory = 1, pickaxey=3}, technic_on_disable = function(pos) technic.swap_node(pos, "technic:lv_led") end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore } for k, v in pairs(common_fields) do diff --git a/technic/machines/LV/music_player.lua b/technic/machines/LV/music_player.lua index b3b41e9..a46687c 100644 --- a/technic/machines/LV/music_player.lua +++ b/technic/machines/LV/music_player.lua @@ -94,7 +94,7 @@ minetest.register_node("technic:music_player", { tiles = {"technic_music_player_top.png", "technic_machine_bottom.png", "technic_music_player_side.png", "technic_music_player_side.png", "technic_music_player_side.png", "technic_music_player_side.png"}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, - technic_machine=1, technic_lv=1}, + technic_machine=1, technic_lv=1, pickaxey=3}, connect_sides = {"bottom"}, sounds = technic.compat.wood_sounds, on_construct = function(pos) @@ -125,6 +125,10 @@ minetest.register_node("technic:music_player", { on_destruct = stop_player, technic_run = run, technic_on_disable = stop_player, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) technic.register_machine("LV", "technic:music_player", technic.receiver) diff --git a/technic/machines/LV/solar_panel.lua b/technic/machines/LV/solar_panel.lua index a93549e..161ee8f 100644 --- a/technic/machines/LV/solar_panel.lua +++ b/technic/machines/LV/solar_panel.lua @@ -48,7 +48,7 @@ minetest.register_node("technic:solar_panel", { tiles = {"technic_solar_panel_top.png", "technic_solar_panel_bottom.png", "technic_solar_panel_side.png", "technic_solar_panel_side.png", "technic_solar_panel_side.png", "technic_solar_panel_side.png"}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, - technic_machine=1, technic_lv=1}, + technic_machine=1, technic_lv=1, pickaxey=3}, connect_sides = {"bottom"}, sounds = technic.compat.wood_sounds, description = S("Small Solar %s Generator"):format("LV"), @@ -66,6 +66,10 @@ minetest.register_node("technic:solar_panel", { meta:set_string("infotext", S("Small Solar %s Generator"):format("LV")) end, technic_run = run, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) technic.register_machine("LV", "technic:solar_panel", technic.producer) diff --git a/technic/machines/LV/water_mill.lua b/technic/machines/LV/water_mill.lua index 8fd7c73..b59d133 100644 --- a/technic/machines/LV/water_mill.lua +++ b/technic/machines/LV/water_mill.lua @@ -78,7 +78,7 @@ minetest.register_node("technic:water_mill", { }, paramtype2 = "facedir", groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, - technic_machine=1, technic_lv=1}, + technic_machine=1, technic_lv=1, pickaxey=3}, legacy_facedir_simple = true, sounds = technic.compat.wood_sounds, on_construct = function(pos) @@ -87,6 +87,10 @@ minetest.register_node("technic:water_mill", { meta:set_int("LV_EU_supply", 0) end, technic_run = run, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node("technic:water_mill_active", { @@ -96,12 +100,16 @@ minetest.register_node("technic:water_mill_active", { "technic_water_mill_side.png", "technic_water_mill_side.png"}, paramtype2 = "facedir", groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, - technic_machine=1, technic_lv=1, not_in_creative_inventory=1}, + technic_machine=1, technic_lv=1, not_in_creative_inventory=1, pickaxey=3}, legacy_facedir_simple = true, sounds = technic.compat.wood_sounds, drop = "technic:water_mill", technic_run = run, technic_disabled_machine_name = "technic:water_mill", + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) technic.register_machine("LV", "technic:water_mill", technic.producer) diff --git a/technic/machines/MV/hydro_turbine.lua b/technic/machines/MV/hydro_turbine.lua index 818923e..6b05edf 100644 --- a/technic/machines/MV/hydro_turbine.lua +++ b/technic/machines/MV/hydro_turbine.lua @@ -75,7 +75,7 @@ minetest.register_node("technic:hydro_turbine", { }, paramtype2 = "facedir", groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, - technic_machine=1, technic_mv=1}, + technic_machine=1, technic_mv=1, pickaxey=3}, legacy_facedir_simple = true, sounds = technic.compat.wood_sounds, on_construct = function(pos) @@ -84,6 +84,10 @@ minetest.register_node("technic:hydro_turbine", { meta:set_int("MV_EU_supply", 0) end, technic_run = run, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node("technic:hydro_turbine_active", { @@ -93,12 +97,16 @@ minetest.register_node("technic:hydro_turbine_active", { "technic_hydro_turbine_side.png", "technic_hydro_turbine_side.png"}, paramtype2 = "facedir", groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, - technic_machine=1, technic_mv=1, not_in_creative_inventory=1}, + technic_machine=1, technic_mv=1, not_in_creative_inventory=1, pickaxey=3}, legacy_facedir_simple = true, sounds = technic.compat.wood_sounds, drop = "technic:hydro_turbine", technic_run = run, technic_disabled_machine_name = "technic:hydro_turbine", + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) technic.register_machine("MV", "technic:hydro_turbine", technic.producer) diff --git a/technic/machines/MV/power_radiator.lua b/technic/machines/MV/power_radiator.lua index c2ade73..993f8b2 100644 --- a/technic/machines/MV/power_radiator.lua +++ b/technic/machines/MV/power_radiator.lua @@ -122,7 +122,7 @@ minetest.register_node("technic:power_radiator", { description = "MV Power Radiator", tiles = {"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png"}, - groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2}, + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, pickaxey=3}, sounds = technic.compat.wood_sounds, drawtype = "nodebox", paramtype = "light", @@ -143,7 +143,11 @@ minetest.register_node("technic:power_radiator", { end, on_punch = function(pos, node, puncher) toggle_on_off_inductive_appliances(pos, node, puncher) - end + end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_abm({ diff --git a/technic/machines/MV/tool_workshop.lua b/technic/machines/MV/tool_workshop.lua index cf67096..ad44a45 100644 --- a/technic/machines/MV/tool_workshop.lua +++ b/technic/machines/MV/tool_workshop.lua @@ -93,7 +93,7 @@ minetest.register_node("technic:tool_workshop", { "technic_workshop_side.png" }, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, - technic_machine=1, technic_mv=1, tubedevice=1, tubedevice_receiver=1}, + technic_machine=1, technic_mv=1, tubedevice=1, tubedevice_receiver=1, pickaxey=3}, connect_sides = {"bottom", "back", "left", "right"}, sounds = technic.compat.wood_sounds, on_construct = function(pos) @@ -119,7 +119,11 @@ minetest.register_node("technic:tool_workshop", { }, technic_run = run, after_place_node = pipeworks.after_place, - after_dig_node = technic.machine_after_dig_node + after_dig_node = technic.machine_after_dig_node, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) technic.register_machine("MV", "technic:tool_workshop", technic.receiver) diff --git a/technic/machines/MV/wind_mill.lua b/technic/machines/MV/wind_mill.lua index dd0c9bc..7b80024 100644 --- a/technic/machines/MV/wind_mill.lua +++ b/technic/machines/MV/wind_mill.lua @@ -24,9 +24,13 @@ minetest.register_node("technic:wind_mill_frame", { drawtype = "glasslike_framed", tiles = {"technic_carbon_steel_block.png", "default_glass.png"}, sunlight_propagates = true, - groups = {cracky=3}, + groups = {cracky=3, pickaxey=3}, sounds = technic.compat.stone_sounds, paramtype = "light", + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) local function check_wind_mill(pos) @@ -70,7 +74,7 @@ minetest.register_node("technic:wind_mill", { description = S("Wind %s Generator"):format("MV"), tiles = {"technic_carbon_steel_block.png"}, paramtype2 = "facedir", - groups = {cracky=1, technic_machine=1, technic_mv=1}, + groups = {cracky=1, technic_machine=1, technic_mv=1, pickaxey=3}, connect_sides = {"top", "bottom", "back", "left", "right"}, sounds = technic.compat.stone_sounds, drawtype = "nodebox", @@ -90,6 +94,10 @@ minetest.register_node("technic:wind_mill", { meta:set_int("MV_EU_supply", 0) end, technic_run = run, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) technic.register_machine("MV", "technic:wind_mill", technic.producer) diff --git a/technic/machines/other/anchor.lua b/technic/machines/other/anchor.lua index 9cccd7e..c5496cc 100644 --- a/technic/machines/other/anchor.lua +++ b/technic/machines/other/anchor.lua @@ -72,7 +72,7 @@ minetest.register_node("technic:admin_anchor", { drawtype = "normal", tiles = {"technic_admin_anchor.png"}, is_ground_content = true, - groups = {cracky=3, not_in_creative_inventory=1}, + groups = {cracky=3, not_in_creative_inventory=1, pickaxey=3}, sounds = technic.compat.stone_sounds, after_place_node = function (pos, placer) local meta = minetest.get_meta(pos) @@ -114,4 +114,8 @@ minetest.register_node("technic:admin_anchor", { end set_display(pos, meta) end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) diff --git a/technic/machines/other/coal_alloy_furnace.lua b/technic/machines/other/coal_alloy_furnace.lua index 1913411..15e328a 100644 --- a/technic/machines/other/coal_alloy_furnace.lua +++ b/technic/machines/other/coal_alloy_furnace.lua @@ -34,7 +34,7 @@ minetest.register_node("technic:coal_alloy_furnace", { "technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_front.png"}, paramtype2 = "facedir", - groups = {cracky=2}, + groups = {cracky=2, pickaxey=3}, legacy_facedir_simple = true, sounds = technic.compat.stone_sounds, on_construct = function(pos) @@ -50,6 +50,10 @@ minetest.register_node("technic:coal_alloy_furnace", { allow_metadata_inventory_put = technic.machine_inventory_put, allow_metadata_inventory_take = technic.machine_inventory_take, allow_metadata_inventory_move = technic.machine_inventory_move, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node("technic:coal_alloy_furnace_active", { @@ -60,13 +64,17 @@ minetest.register_node("technic:coal_alloy_furnace_active", { paramtype2 = "facedir", light_source = 8, drop = "technic:coal_alloy_furnace", - groups = {cracky=2, not_in_creative_inventory=1}, + groups = {cracky=2, not_in_creative_inventory=1, pickaxey=3}, legacy_facedir_simple = true, sounds = technic.compat.stone_sounds, can_dig = technic.machine_can_dig, allow_metadata_inventory_put = technic.machine_inventory_put, allow_metadata_inventory_take = technic.machine_inventory_take, allow_metadata_inventory_move = technic.machine_inventory_move, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_abm({ diff --git a/technic/machines/other/constructor.lua b/technic/machines/other/constructor.lua index 6565028..2b26fc0 100644 --- a/technic/machines/other/constructor.lua +++ b/technic/machines/other/constructor.lua @@ -140,7 +140,7 @@ local function make_constructor(mark, length) "technic_constructor_front_off.png"}, paramtype2 = "facedir", groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, - mesecon = 2, technic_constructor = 1}, + mesecon = 2, technic_constructor = 1, pickaxey=3}, mesecons = {effector = {action_on = make_on(mark, length)}}, sounds = technic.compat.stone_sounds, on_construct = function(pos) @@ -179,7 +179,11 @@ local function make_constructor(mark, length) allow_metadata_inventory_put = allow_inventory_put, allow_metadata_inventory_take = technic.machine_inventory_take, allow_metadata_inventory_move = technic.machine_inventory_move, - on_rotate = screwdriver.rotate_simple + on_rotate = screwdriver.rotate_simple, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_node("technic:constructor_mk"..mark.."_on", { @@ -192,13 +196,17 @@ local function make_constructor(mark, length) paramtype2 = "facedir", drop = "technic:constructor_mk"..mark.."_off", groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, - mesecon=2, not_in_creative_inventory=1, technic_constructor=1}, + mesecon=2, not_in_creative_inventory=1, technic_constructor=1, pickaxey = 3}, mesecons= {effector = {action_off = make_off(mark)}}, sounds = technic.compat.stone_sounds, allow_metadata_inventory_put = allow_inventory_put, allow_metadata_inventory_take = technic.machine_inventory_take, allow_metadata_inventory_move = technic.machine_inventory_move, - on_rotate = false + on_rotate = false, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) end diff --git a/technic/machines/other/frames.lua b/technic/machines/other/frames.lua index 1b9e3ea..cd0d224 100644 --- a/technic/machines/other/frames.lua +++ b/technic/machines/other/frames.lua @@ -236,7 +236,7 @@ for zp = 0, 1 do end local nameext = string.format("%d%d%d%d%d%d", xm, xp, ym, yp, zm, zp) - local groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2 } + local groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, pickaxey=3} if nameext ~= "111111" then groups.not_in_creative_inventory = 1 end @@ -373,6 +373,10 @@ for zp = 0, 1 do end end end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) end @@ -616,7 +620,7 @@ minetest.register_node("technic:frame_motor", { "pipeworks_filter_top.png^[transformR90", "technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png" }, - groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, mesecon = 2 }, + groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, mesecon = 2, pickaxey=3}, paramtype2 = "facedir", mesecons = { effector = { action_on = frame_motor_on } }, @@ -633,7 +637,10 @@ minetest.register_node("technic:frame_motor", { { x = -1, y = 0, z = 0 }, { x = 0, y = -1, z = 0 } })[math.floor(node.param2 / 4) + 1] return dir2.x ~= -dir.x or dir2.y ~= -dir.y or dir2.z ~= -dir.z - end + end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, }) @@ -825,37 +832,46 @@ minetest.register_node("technic:template", { description = S("Template"), tiles = { "technic_mv_cable.png" }, drop = "", - groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2 }, + groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, pickaxey=3}, on_destruct = template_on_destruct, after_dig_node = template_drops, on_punch = function(pos, node, puncher) swap_template(pos, "technic:template_disabled") - end + end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, }) minetest.register_node("technic:template_disabled", { description = S("Template"), tiles = { "technic_hv_cable.png" }, drop = "", - groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, not_in_creative_inventory = 1 }, + groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, not_in_creative_inventory = 1, pickaxey=3}, on_destruct = template_on_destruct, after_dig_node = template_drops, on_punch = function(pos, node, puncher) local _ = minetest.get_meta(pos) swap_template(pos, "technic:template_connector") - end + end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, }) minetest.register_node("technic:template_connector", { description = S("Template"), tiles = { "technic_lv_cable.png" }, drop = "", - groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, not_in_creative_inventory = 1 }, + groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, not_in_creative_inventory = 1, pickaxey=3}, on_destruct = template_on_destruct, after_dig_node = template_drops, on_punch = function(pos, node, puncher) swap_template(pos, "technic:template") - end + end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, }) minetest.register_craftitem("technic:template_replacer", { @@ -949,13 +965,16 @@ minetest.register_node("technic:template_motor", { "technic_lv_cable.png", "technic_lv_cable.png" }, - groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, mesecon = 2 }, + groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, mesecon = 2, pickaxey=3}, paramtype2 = "facedir", mesecons = { effector = { action_on = template_motor_on } }, after_place_node = function(pos, placer, itemstack) local meta = minetest.get_meta(pos) meta:set_string("owner", placer:get_player_name()) end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, }) -- Crafts diff --git a/technic/machines/other/injector.lua b/technic/machines/other/injector.lua index eda455f..bd53c50 100644 --- a/technic/machines/other/injector.lua +++ b/technic/machines/other/injector.lua @@ -90,7 +90,7 @@ minetest.register_node("technic:injector", { "technic_injector_side.png" }, paramtype2 = "facedir", - groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice=1, tubedevice_receiver=1}, + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice=1, tubedevice_receiver=1, pickaxey=3}, tube = { can_insert = function(pos, node, stack, direction) local meta = minetest.get_meta(pos) @@ -140,7 +140,10 @@ minetest.register_node("technic:injector", { allow_metadata_inventory_take = technic.machine_inventory_take, allow_metadata_inventory_move = technic.machine_inventory_move, after_place_node = pipeworks.after_place, - after_dig_node = pipeworks.after_dig + after_dig_node = pipeworks.after_dig, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, }) minetest.register_abm({ diff --git a/technic/machines/power_monitor.lua b/technic/machines/power_monitor.lua index 19a9e35..0baefa7 100644 --- a/technic/machines/power_monitor.lua +++ b/technic/machines/power_monitor.lua @@ -26,13 +26,17 @@ minetest.register_node("technic:power_monitor",{ "technic_power_monitor_front.png" }, paramtype2 = "facedir", - groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1, technic_machine=1}, + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1, technic_machine=1,pickaxey=3}, connect_sides = {"bottom", "back"}, sounds = technic.compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Power Monitor")) end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_abm({ diff --git a/technic/machines/register/battery_box.lua b/technic/machines/register/battery_box.lua index 2594844..a427e06 100644 --- a/technic/machines/register/battery_box.lua +++ b/technic/machines/register/battery_box.lua @@ -266,7 +266,7 @@ function technic.register_battery_box(data) for i = 0, 8 do local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, - technic_machine=1, ["technic_"..ltier]=1} + technic_machine=1, ["technic_"..ltier]=1, pickaxey=3} if i ~= 0 then groups.not_in_creative_inventory = 1 end @@ -381,6 +381,9 @@ function technic.register_battery_box(data) end }, }, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, }) end diff --git a/technic/machines/register/cables.lua b/technic/machines/register/cables.lua index ed3dfce..a35b001 100644 --- a/technic/machines/register/cables.lua +++ b/technic/machines/register/cables.lua @@ -213,6 +213,9 @@ function technic.register_cable(tier, size) "group:technic_"..ltier, "group:technic_all_tiers"}, on_construct = clear_networks, on_destruct = clear_networks, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true } def.node_box.fixed = { {-size, -size, -size, size, size, size}, diff --git a/technic/machines/register/generator.lua b/technic/machines/register/generator.lua index af2ff64..88e78d8 100644 --- a/technic/machines/register/generator.lua +++ b/technic/machines/register/generator.lua @@ -26,12 +26,12 @@ function technic.register_generator(data) local ltier = string.lower(tier) local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, - technic_machine=1, ["technic_"..ltier]=1} + technic_machine=1, ["technic_"..ltier]=1, pickaxey=3} if data.tube then groups.tubedevice = 1 groups.tubedevice_receiver = 1 end - local active_groups = {not_in_creative_inventory = 1} + local active_groups = {not_in_creative_inventory = 1, pickaxey=3} for k, v in pairs(groups) do active_groups[k] = v end local generator_formspec = @@ -176,6 +176,9 @@ function technic.register_generator(data) end meta:set_string("formspec", generator_formspec..form_buttons) end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, }) minetest.register_node("technic:"..ltier.."_generator_active", { @@ -284,6 +287,9 @@ function technic.register_generator(data) form_buttons ) end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true }) technic.register_machine(tier, "technic:"..ltier.."_generator", technic.producer) diff --git a/technic/machines/register/machine_base.lua b/technic/machines/register/machine_base.lua index f8a1528..5227955 100644 --- a/technic/machines/register/machine_base.lua +++ b/technic/machines/register/machine_base.lua @@ -41,12 +41,12 @@ function technic.register_base_machine(data) data.modname = data.modname or minetest.get_current_modname() - local groups = {cracky = 2, technic_machine = 1, ["technic_"..ltier] = 1} + local groups = {cracky = 2, technic_machine = 1, ["technic_"..ltier] = 1, pickaxey=3} if data.tube then groups.tubedevice = 1 groups.tubedevice_receiver = 1 end - local active_groups = {not_in_creative_inventory = 1} + local active_groups = {not_in_creative_inventory = 1, pickaxey=3} for k, v in pairs(groups) do active_groups[k] = v end local formspec = @@ -228,6 +228,9 @@ function technic.register_base_machine(data) end meta:set_string("formspec", formspec..form_buttons) end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true }) minetest.register_node(data.modname..":"..ltier.."_"..machine_name.."_active",{ @@ -273,6 +276,9 @@ function technic.register_base_machine(data) end meta:set_string("formspec", formspec..form_buttons) end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true }) technic.register_machine(tier, data.modname..":"..ltier.."_"..machine_name, technic.receiver) diff --git a/technic/machines/register/solar_array.lua b/technic/machines/register/solar_array.lua index 0d007ad..ca60ca8 100644 --- a/technic/machines/register/solar_array.lua +++ b/technic/machines/register/solar_array.lua @@ -43,7 +43,7 @@ function technic.register_solar_array(data) tiles = {"technic_"..ltier.."_solar_array_top.png", "technic_"..ltier.."_solar_array_bottom.png", "technic_"..ltier.."_solar_array_side.png", "technic_"..ltier.."_solar_array_side.png", "technic_"..ltier.."_solar_array_side.png", "technic_"..ltier.."_solar_array_side.png"}, - groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, ["technic_"..ltier]=1}, + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, ["technic_"..ltier]=1, pickaxey=3}, connect_sides = {"bottom"}, sounds = technic.compat.wood_sounds, description = S("Arrayed Solar %s Generator"):format(tier), @@ -59,6 +59,9 @@ function technic.register_solar_array(data) meta:set_int(tier.."_EU_supply", 0) end, technic_run = run, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true }) technic.register_machine(tier, "technic:solar_array_"..ltier, technic.producer) diff --git a/technic/machines/supply_converter.lua b/technic/machines/supply_converter.lua index 31e5411..bb3c380 100644 --- a/technic/machines/supply_converter.lua +++ b/technic/machines/supply_converter.lua @@ -198,7 +198,7 @@ minetest.register_node("technic:supply_converter", { "technic_supply_converter_side.png" }, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, - technic_machine=1, technic_all_tiers=1}, + technic_machine=1, technic_all_tiers=1, pickaxey=3}, connect_sides = {"top", "bottom"}, sounds = technic.compat.wood_sounds, on_receive_fields = supply_converter_receive_fields, @@ -218,6 +218,10 @@ minetest.register_node("technic:supply_converter", { digiline = digiline_def, technic_run = run, technic_on_disable = run, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore }) minetest.register_craft({ diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua index a792955..75140ea 100644 --- a/technic/machines/switching_station.lua +++ b/technic/machines/switching_station.lua @@ -36,7 +36,7 @@ minetest.register_node("technic:switching_station",{ "technic_water_mill_top_active.png", "technic_water_mill_top_active.png", "technic_water_mill_top_active.png"}, - groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1}, + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1,pickaxey=3}, connect_sides = {"bottom"}, sounds = technic.compat.wood_sounds, on_construct = function(pos) diff --git a/technic/tools/flashlight.lua b/technic/tools/flashlight.lua index 84decbb..e2f59e1 100644 --- a/technic/tools/flashlight.lua +++ b/technic/tools/flashlight.lua @@ -113,11 +113,14 @@ minetest.register_node("technic:light", { drawtype = "glasslike", tiles = {"technic_light.png"}, paramtype = "light", - groups = {not_in_creative_inventory = 1}, + groups = {not_in_creative_inventory = 1, pickaxey=3}, drop = "", walkable = false, buildable_to = true, sunlight_propagates = true, light_source = minetest.LIGHT_MAX, pointable = false, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true }) diff --git a/technic_chests/register.lua b/technic_chests/register.lua index 1ac8406..0826816 100644 --- a/technic_chests/register.lua +++ b/technic_chests/register.lua @@ -321,7 +321,12 @@ function technic.chests:definition(name, data) minetest.remove_node(pos) return drops end, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true } + def.groups.pickaxey = 3 + if data.locked then def.allow_metadata_inventory_move = self.inv_move def.allow_metadata_inventory_put = self.inv_put diff --git a/technic_cnc/cnc.lua b/technic_cnc/cnc.lua index 2c15d8c..d10244b 100644 --- a/technic_cnc/cnc.lua +++ b/technic_cnc/cnc.lua @@ -250,7 +250,7 @@ minetest.register_node(":technic:cnc", { description = desc_tr, tiles = {"technic_cnc_top.png", "technic_cnc_bottom.png", "technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_front.png"}, - groups = {cracky=2, technic_machine=1, technic_lv=1}, + groups = {cracky=2, technic_machine=1, technic_lv=1, pickaxey=3}, connect_sides = {"bottom", "back", "left", "right"}, paramtype2 = "facedir", legacy_facedir_simple = true, @@ -269,6 +269,9 @@ minetest.register_node(":technic:cnc", { allow_metadata_inventory_move = allow_metadata_inventory_move, on_receive_fields = form_handler, technic_run = technic_cnc.use_technic and run, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true }) -- Active state block @@ -278,7 +281,7 @@ if technic_cnc.use_technic then description = desc_tr, tiles = {"technic_cnc_top_active.png", "technic_cnc_bottom.png", "technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_front_active.png"}, - groups = {cracky=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1}, + groups = {cracky=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1, pickaxey=3}, connect_sides = {"bottom", "back", "left", "right"}, paramtype2 = "facedir", drop = "technic:cnc", @@ -290,6 +293,9 @@ if technic_cnc.use_technic then on_receive_fields = form_handler, technic_run = run, technic_disabled_machine_name = "technic:cnc", + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true }) technic.register_machine("LV", "technic:cnc", technic.receiver) diff --git a/technic_cnc/cnc_api.lua b/technic_cnc/cnc_api.lua index 41fbe1b..2aa876b 100644 --- a/technic_cnc/cnc_api.lua +++ b/technic_cnc/cnc_api.lua @@ -273,7 +273,8 @@ technic_cnc.programs_disable = { -- Generic function for registering all the different node types function technic_cnc.register_program(recipeitem, suffix, model, groups, images, description, cbox, sbox) - + groups.pickaxey = 3 + local dtype local nodeboxdef local meshdef @@ -303,7 +304,10 @@ function technic_cnc.register_program(recipeitem, suffix, model, groups, images, walkable = true, groups = groups, selection_box = sbox, - collision_box = cbox + collision_box = cbox, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true }) end diff --git a/technic_worldgen/rubber.lua b/technic_worldgen/rubber.lua index fea1346..dbb52da 100644 --- a/technic_worldgen/rubber.lua +++ b/technic_worldgen/rubber.lua @@ -10,8 +10,11 @@ minetest.register_node(":moretrees:rubber_tree_sapling", { wield_image = "technic_rubber_sapling.png", paramtype = "light", walkable = false, - groups = {dig_immediate=3, flammable=2, sapling=1}, + groups = {dig_immediate=3, flammable=2, sapling=1, pickaxey=1, handy=1}, sounds = sounds.node_sound_defaults(), + _mcl_hardness = 1, + _mcl_blast_resistance = 1, + _mcl_silk_touch_drop = true }) minetest.register_craft({ @@ -25,8 +28,11 @@ minetest.register_node(":moretrees:rubber_tree_trunk", { tiles = {"default_tree_top.png", "default_tree_top.png", "technic_rubber_tree_full.png"}, groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1, - flammable=2}, + flammable=2, handy=1}, sounds = sounds.node_sound_wood_defaults(), + _mcl_hardness = 1, + _mcl_blast_resistance = 1, + _mcl_silk_touch_drop = true }) minetest.register_node(":moretrees:rubber_tree_trunk_empty", { @@ -34,8 +40,11 @@ minetest.register_node(":moretrees:rubber_tree_trunk_empty", { tiles = {"default_tree_top.png", "default_tree_top.png", "technic_rubber_tree_empty.png"}, groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1, - flammable=2, not_in_creative_inventory=1}, + flammable=2, not_in_creative_inventory=1,handy=1}, sounds = sounds.node_sound_wood_defaults(), + _mcl_hardness = 1, + _mcl_blast_resistance = 1, + _mcl_silk_touch_drop = true }) minetest.register_node(":moretrees:rubber_tree_leaves", { @@ -43,7 +52,7 @@ minetest.register_node(":moretrees:rubber_tree_leaves", { description = S("Rubber Tree Leaves"), tiles = {"technic_rubber_leaves.png"}, paramtype = "light", - groups = {snappy=3, leafdecay=3, flammable=2, leaves=1}, + groups = {snappy=3, leafdecay=3, flammable=2, leaves=1,}, drop = { max_items = 1, items = {{ @@ -55,7 +64,10 @@ minetest.register_node(":moretrees:rubber_tree_leaves", { } } }, - sounds = sounds.node_sound_leaves_defaults() + sounds = sounds.node_sound_leaves_defaults(), + _mcl_hardness = 1, + _mcl_blast_resistance = 1, + _mcl_silk_touch_drop = true }) technic.rubber_tree_model={ @@ -91,8 +103,17 @@ if technic.config:get_bool("enable_rubber_tree_generation") then x = (maxp.x - minp.x) / 2 + minp.x, y = (maxp.y - minp.y) / 2 + minp.y, z = (maxp.z - minp.z) / 2 + minp.z} + local near_node = nil + if minetest.get_modpath("mcl_core") then + near_node = "mcl_core:dirt_with_grass" + else if minetest.get_modpath("default") then + near_node = "default:dirt_with_grass" + else + error(S("[TECHNIC] Cant generate rubber trees as default or mcl_core is not installed, please use a mineclone compatible game or minetest_game")) + end + end local pos = minetest.find_node_near(tmp, maxp.x - minp.x, - {"default:dirt_with_grass"}) + near_node) if pos ~= nil then minetest.spawn_tree({x=pos.x, y=pos.y+1, z=pos.z}, technic.rubber_tree_model) end From 588d36ba09a74f3a86473be07a89b297faacd5e8 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Thu, 28 Dec 2023 09:54:09 +0000 Subject: [PATCH 21/32] Added technic_compat mod to keep compatability functions accessable to the whole modpack --- concrete/mod.conf | 1 + extranodes/mod.conf | 2 +- technic/crafts.lua | 46 ++--- technic/init.lua | 6 - technic/items.lua | 4 +- technic/machines/HV/forcefield.lua | 6 +- technic/machines/HV/nuclear_reactor.lua | 6 +- technic/machines/LV/alloy_furnace.lua | 6 +- technic/machines/LV/cables.lua | 6 +- technic/machines/LV/compressor.lua | 2 +- technic/machines/LV/electric_furnace.lua | 6 +- technic/machines/LV/generator.lua | 6 +- technic/machines/LV/geothermal.lua | 8 +- technic/machines/LV/grinder.lua | 6 +- technic/machines/LV/lamp.lua | 2 +- technic/machines/LV/music_player.lua | 8 +- technic/machines/LV/solar_panel.lua | 2 +- technic/machines/LV/water_mill.lua | 6 +- technic/machines/MV/hydro_turbine.lua | 4 +- technic/machines/MV/lighting.lua | 24 +-- technic/machines/MV/power_radiator.lua | 2 +- technic/machines/MV/tool_workshop.lua | 6 +- technic/machines/MV/wind_mill.lua | 4 +- technic/machines/other/anchor.lua | 2 +- technic/machines/other/coal_alloy_furnace.lua | 10 +- technic/machines/other/constructor.lua | 4 +- technic/machines/other/frames.lua | 4 +- technic/machines/other/injector.lua | 4 +- technic/machines/power_monitor.lua | 4 +- technic/machines/register/battery_box.lua | 6 +- technic/machines/register/cables.lua | 4 +- technic/machines/register/common.lua | 4 +- technic/machines/register/generator.lua | 4 +- technic/machines/register/grinder_recipes.lua | 6 +- technic/machines/register/machine_base.lua | 4 +- technic/machines/register/solar_array.lua | 2 +- technic/machines/supply_converter.lua | 2 +- technic/machines/switching_station.lua | 4 +- technic/mcl_craftguide.lua | 188 ----------------- technic/mcl_support.lua | 110 ---------- technic/mod.conf | 2 +- technic/radiation.lua | 8 +- technic/tools/cans.lua | 4 +- technic/tools/mining_drill.lua | 4 +- technic/tools/mining_lasers.lua | 12 +- technic/tools/sonic_screwdriver.lua | 6 +- technic/tools/tree_tap.lua | 4 +- technic_chests/mod.conf | 2 +- technic_cnc/mod.conf | 2 +- technic_compat/init.lua | 16 ++ technic_compat/mcl/craftguide.lua | 189 ++++++++++++++++++ technic_compat/mcl/crafting.lua | 102 ++++++++++ technic_compat/mcl/miscellaneous.lua | 1 + technic_compat/mcl/sounds.lua | 1 + technic_compat/mcl/textures.lua | 10 + technic_compat/mod.conf | 4 + technic_worldgen/mod.conf | 2 +- 57 files changed, 460 insertions(+), 440 deletions(-) delete mode 100644 technic/mcl_craftguide.lua delete mode 100644 technic/mcl_support.lua create mode 100644 technic_compat/init.lua create mode 100644 technic_compat/mcl/craftguide.lua create mode 100644 technic_compat/mcl/crafting.lua create mode 100644 technic_compat/mcl/miscellaneous.lua create mode 100644 technic_compat/mcl/sounds.lua create mode 100644 technic_compat/mcl/textures.lua create mode 100644 technic_compat/mod.conf diff --git a/concrete/mod.conf b/concrete/mod.conf index 5a17f88..cd02408 100644 --- a/concrete/mod.conf +++ b/concrete/mod.conf @@ -1,3 +1,4 @@ name = concrete +depends = technic_compat optional_depends = basic_materials, intllib, moreblocks, default supported_games = minetest_game,mineclone2,mineclonia,mineclone5 \ No newline at end of file diff --git a/extranodes/mod.conf b/extranodes/mod.conf index 5963baf..e7b5e5e 100644 --- a/extranodes/mod.conf +++ b/extranodes/mod.conf @@ -1,4 +1,4 @@ name = extranodes -depends = technic_worldgen, basic_materials, concrete +depends = technic_worldgen, basic_materials, concrete, technic_compat optional_depends = unifieddyes, intllib, moreblocks, steel, streetsmod, default, mcl_core, mcl_sounds supported_games = minetest_game,mineclone2,mineclonia,mineclone5 \ No newline at end of file diff --git a/technic/crafts.lua b/technic/crafts.lua index 530ab1d..7cc0add 100644 --- a/technic/crafts.lua +++ b/technic/crafts.lua @@ -38,9 +38,9 @@ if pipeworks.enable_teleport_tube then minetest.register_craft({ output = 'pipeworks:teleport_tube_1', recipe = { - {technic.compat.mese_crystal_ingredient, 'technic:copper_coil', technic.compat.mese_crystal_ingredient}, + {technic_compat.mese_crystal_ingredient, 'technic:copper_coil', technic_compat.mese_crystal_ingredient}, {'pipeworks:tube_1', 'technic:control_logic_unit', 'pipeworks:tube_1'}, - {technic.compat.mese_crystal_ingredient, 'technic:copper_coil', technic.compat.mese_crystal_ingredient}, + {technic_compat.mese_crystal_ingredient, 'technic:copper_coil', technic_compat.mese_crystal_ingredient}, } }) end @@ -62,36 +62,36 @@ minetest.register_craft( { minetest.register_craft({ output = 'technic:diamond_drill_head', recipe = { - {'technic:stainless_steel_ingot', technic.compat.diamond_ingredient, 'technic:stainless_steel_ingot'}, - {technic.compat.diamond_ingredient, '', technic.compat.diamond_ingredient}, - {'technic:stainless_steel_ingot', technic.compat.diamond_ingredient, 'technic:stainless_steel_ingot'}, + {'technic:stainless_steel_ingot', technic_compat.diamond_ingredient, 'technic:stainless_steel_ingot'}, + {technic_compat.diamond_ingredient, '', technic_compat.diamond_ingredient}, + {'technic:stainless_steel_ingot', technic_compat.diamond_ingredient, 'technic:stainless_steel_ingot'}, } }) minetest.register_craft({ output = 'technic:green_energy_crystal', recipe = { - {technic.compat.gold_ingot_ingredient, 'technic:battery', technic.compat.green_dye_ingredient}, + {technic_compat.gold_ingot_ingredient, 'technic:battery', technic_compat.green_dye_ingredient}, {'technic:battery', 'technic:red_energy_crystal', 'technic:battery'}, - {technic.compat.green_dye_ingredient, 'technic:battery', technic.compat.gold_ingot_ingredient}, + {technic_compat.green_dye_ingredient, 'technic:battery', technic_compat.gold_ingot_ingredient}, } }) minetest.register_craft({ output = 'technic:blue_energy_crystal', recipe = { - {'moreores:mithril_ingot', 'technic:battery', technic.compat.blue_dye_ingredient}, + {'moreores:mithril_ingot', 'technic:battery', technic_compat.blue_dye_ingredient}, {'technic:battery', 'technic:green_energy_crystal', 'technic:battery'}, - {technic.compat.blue_dye_ingredient, 'technic:battery', 'moreores:mithril_ingot'}, + {technic_compat.blue_dye_ingredient, 'technic:battery', 'moreores:mithril_ingot'}, } }) minetest.register_craft({ output = 'technic:red_energy_crystal', recipe = { - {'moreores:silver_ingot', 'technic:battery', technic.compat.red_dye_ingredient}, + {'moreores:silver_ingot', 'technic:battery', technic_compat.red_dye_ingredient}, {'technic:battery', 'basic_materials:energy_crystal_simple', 'technic:battery'}, - {technic.compat.red_dye_ingredient, 'technic:battery', 'moreores:silver_ingot'}, + {technic_compat.red_dye_ingredient, 'technic:battery', 'moreores:silver_ingot'}, } }) @@ -143,7 +143,7 @@ minetest.register_craft({ output = 'technic:control_logic_unit', recipe = { {'', 'basic_materials:gold_wire', ''}, - {technic.compat.copper_ingredient, 'technic:silicon_wafer', technic.compat.copper_ingredient}, + {technic_compat.copper_ingredient, 'technic:silicon_wafer', technic_compat.copper_ingredient}, {'', 'technic:chromium_ingot', ''}, }, replacements = { {"basic_materials:gold_wire", "basic_materials:empty_spool"}, }, @@ -153,8 +153,8 @@ minetest.register_craft({ output = 'technic:mixed_metal_ingot 9', recipe = { {'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'}, - {technic.compat.bronze_ingredient, technic.compat.bronze_ingredient, technic.compat.bronze_ingredient}, - {technic.compat.tin_ingredient, technic.compat.tin_ingredient, technic.compat.tin_ingredient}, + {technic_compat.bronze_ingredient, technic_compat.bronze_ingredient, technic_compat.bronze_ingredient}, + {technic_compat.tin_ingredient, technic_compat.tin_ingredient, technic_compat.tin_ingredient}, } }) @@ -175,7 +175,7 @@ minetest.register_craft({ }) minetest.register_craft({ - output = technic.compat.dirt_ingredient.." 2", + output = technic_compat.dirt_ingredient.." 2", type = "shapeless", replacements = {{"bucket:bucket_water","bucket:bucket_empty"}}, recipe = { @@ -191,14 +191,14 @@ minetest.register_craft({ type = "shapeless", recipe = { "technic:raw_latex", - technic.compat.coal_ingredient, - technic.compat.coal_ingredient, - technic.compat.coal_ingredient, - technic.compat.coal_ingredient, - technic.compat.coal_ingredient, - technic.compat.coal_ingredient, - technic.compat.coal_ingredient, - technic.compat.coal_ingredient, + technic_compat.coal_ingredient, + technic_compat.coal_ingredient, + technic_compat.coal_ingredient, + technic_compat.coal_ingredient, + technic_compat.coal_ingredient, + technic_compat.coal_ingredient, + technic_compat.coal_ingredient, + technic_compat.coal_ingredient, }, }) diff --git a/technic/init.lua b/technic/init.lua index 3f469bc..e25dd82 100644 --- a/technic/init.lua +++ b/technic/init.lua @@ -48,12 +48,6 @@ end -- Read configuration file dofile(modpath.."/config.lua") - --- MineClone2 Support -dofile(modpath.."/mcl_support.lua") - -dofile(modpath.."/mcl_craftguide.lua") - -- Helper functions dofile(modpath.."/helpers.lua") diff --git a/technic/items.lua b/technic/items.lua index ab2bed7..26847cf 100644 --- a/technic/items.lua +++ b/technic/items.lua @@ -131,7 +131,7 @@ minetest.register_node("technic:machine_casing", { paramtype = "light", drawtype = "allfaces", tiles = {"technic_machine_casing.png"}, - sounds = technic.compat.stone_sounds, + sounds = technic_compat.stone_sounds, }) minetest.register_craftitem("technic:rubber_goo", { @@ -188,7 +188,7 @@ for p = 0, 35 do is_ground_content = true, groups = {uranium_block=1, not_in_creative_inventory=nici, cracky=1, level=2, radioactive=radioactivity}, - sounds = technic.compat.stone_sounds, + sounds = technic_compat.stone_sounds, }); if not ov then minetest.register_craft({ diff --git a/technic/machines/HV/forcefield.lua b/technic/machines/HV/forcefield.lua index 72ada04..1613a49 100644 --- a/technic/machines/HV/forcefield.lua +++ b/technic/machines/HV/forcefield.lua @@ -17,9 +17,9 @@ local cable_entry = "^technic_cable_connection_overlay.png" minetest.register_craft({ output = "technic:forcefield_emitter_off", recipe = { - {technic.compat.mese_block_ingredient, "basic_materials:motor", technic.compat.mese_block_ingredient}, + {technic_compat.mese_block_ingredient, "basic_materials:motor", technic_compat.mese_block_ingredient}, {"technic:deployer_off", "technic:machine_casing", "technic:deployer_off"}, - {technic.compat.mese_block_ingredient, "technic:hv_cable", technic.compat.mese_block_ingredient}, + {technic_compat.mese_block_ingredient, "technic:hv_cable", technic_compat.mese_block_ingredient}, } }) @@ -362,7 +362,7 @@ minetest.register_node("technic:forcefield", { drawtype = "glasslike", groups = {not_in_creative_inventory=1}, paramtype = "light", - light_source = technic.compat.mt_light_max, + light_source = technic_compat.mt_light_max, diggable = false, drop = '', tiles = {{ diff --git a/technic/machines/HV/nuclear_reactor.lua b/technic/machines/HV/nuclear_reactor.lua index 43ac769..78d15cc 100644 --- a/technic/machines/HV/nuclear_reactor.lua +++ b/technic/machines/HV/nuclear_reactor.lua @@ -24,7 +24,7 @@ local cable_entry = "^technic_cable_connection_overlay.png" minetest.register_craft({ output = 'technic:hv_nuclear_reactor_core', recipe = { - {'technic:carbon_plate', technic.compat.obsidian_glass_ingredient, 'technic:carbon_plate'}, + {'technic:carbon_plate', technic_compat.obsidian_glass_ingredient, 'technic:carbon_plate'}, {'technic:composite_plate', 'technic:machine_casing', 'technic:composite_plate'}, {'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'}, } @@ -414,7 +414,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core", { mesh = "technic_reactor.obj", groups = {cracky = 1, technic_machine = 1, technic_hv = 1, digiline_remote_receive = 1,pickaxey=3}, legacy_facedir_simple = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, paramtype = "light", paramtype2 = "facedir", stack_max = 1, @@ -453,7 +453,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core_active", { groups = {cracky = 1, technic_machine = 1, technic_hv = 1, radioactive = 4, not_in_creative_inventory = 1, digiline_remote_receive = 1,pickaxey=3}, legacy_facedir_simple = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, drop = "technic:hv_nuclear_reactor_core", light_source = 14, paramtype = "light", diff --git a/technic/machines/LV/alloy_furnace.lua b/technic/machines/LV/alloy_furnace.lua index a16972a..379fd15 100644 --- a/technic/machines/LV/alloy_furnace.lua +++ b/technic/machines/LV/alloy_furnace.lua @@ -4,9 +4,9 @@ minetest.register_craft({ output = 'technic:lv_alloy_furnace', recipe = { - {technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient}, - {technic.compat.brick_block_ingredient, 'technic:machine_casing', technic.compat.brick_block_ingredient}, - {technic.compat.brick_block_ingredient, 'technic:lv_cable', technic.compat.brick_block_ingredient}, + {technic_compat.brick_block_ingredient, technic_compat.brick_block_ingredient, technic_compat.brick_block_ingredient}, + {technic_compat.brick_block_ingredient, 'technic:machine_casing', technic_compat.brick_block_ingredient}, + {technic_compat.brick_block_ingredient, 'technic:lv_cable', technic_compat.brick_block_ingredient}, } }) diff --git a/technic/machines/LV/cables.lua b/technic/machines/LV/cables.lua index 8fcc0e7..74c55fe 100644 --- a/technic/machines/LV/cables.lua +++ b/technic/machines/LV/cables.lua @@ -4,9 +4,9 @@ minetest.register_alias("lv_cable", "technic:lv_cable") minetest.register_craft({ output = 'technic:lv_cable 6', recipe = { - {technic.compat.paper_ingredient, technic.compat.paper_ingredient, technic.compat.paper_ingredient}, - {technic.compat.copper_ingredient, technic.compat.copper_ingredient, technic.compat.copper_ingredient}, - {technic.compat.paper_ingredient, technic.compat.paper_ingredient, technic.compat.paper_ingredient}, + {technic_compat.paper_ingredient, technic_compat.paper_ingredient, technic_compat.paper_ingredient}, + {technic_compat.copper_ingredient, technic_compat.copper_ingredient, technic_compat.copper_ingredient}, + {technic_compat.paper_ingredient, technic_compat.paper_ingredient, technic_compat.paper_ingredient}, } }) diff --git a/technic/machines/LV/compressor.lua b/technic/machines/LV/compressor.lua index 5c1d089..0a24ed2 100644 --- a/technic/machines/LV/compressor.lua +++ b/technic/machines/LV/compressor.lua @@ -4,7 +4,7 @@ minetest.register_alias("compressor", "technic:lv_compressor") minetest.register_craft({ output = 'technic:lv_compressor', recipe = { - {technic.compat.stone_ingredient, 'basic_materials:motor', technic.compat.stone_ingredient}, + {technic_compat.stone_ingredient, 'basic_materials:motor', technic_compat.stone_ingredient}, {'mesecons:piston', 'technic:machine_casing', 'mesecons:piston'}, {'basic_materials:silver_wire', 'technic:lv_cable', 'basic_materials:silver_wire'}, }, diff --git a/technic/machines/LV/electric_furnace.lua b/technic/machines/LV/electric_furnace.lua index efb0cfe..cd5f38e 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 = { - {technic.compat.cobble_ingredient, technic.compat.cobble_ingredient, technic.compat.cobble_ingredient}, - {technic.compat.cobble_ingredient, 'technic:machine_casing', technic.compat.cobble_ingredient}, - {technic.compat.cobble_ingredient, 'technic:lv_cable', technic.compat.cobble_ingredient}, + {technic_compat.cobble_ingredient, technic_compat.cobble_ingredient, technic_compat.cobble_ingredient}, + {technic_compat.cobble_ingredient, 'technic:machine_casing', technic_compat.cobble_ingredient}, + {technic_compat.cobble_ingredient, 'technic:lv_cable', technic_compat.cobble_ingredient}, } }) diff --git a/technic/machines/LV/generator.lua b/technic/machines/LV/generator.lua index 66a9db4..31f78ea 100644 --- a/technic/machines/LV/generator.lua +++ b/technic/machines/LV/generator.lua @@ -8,9 +8,9 @@ minetest.register_alias("lv_generator", "technic:lv_generator") minetest.register_craft({ output = 'technic:lv_generator', recipe = { - {technic.compat.stone_ingredient, technic.compat.furnace_ingredient, technic.compat.stone_ingredient}, - {technic.compat.stone_ingredient, 'technic:machine_casing', technic.compat.stone_ingredient}, - {technic.compat.stone_ingredient, 'technic:lv_cable', technic.compat.stone_ingredient}, + {technic_compat.stone_ingredient, technic_compat.furnace_ingredient, technic_compat.stone_ingredient}, + {technic_compat.stone_ingredient, 'technic:machine_casing', technic_compat.stone_ingredient}, + {technic_compat.stone_ingredient, 'technic:lv_cable', technic_compat.stone_ingredient}, } }) diff --git a/technic/machines/LV/geothermal.lua b/technic/machines/LV/geothermal.lua index 823d250..e6ae085 100644 --- a/technic/machines/LV/geothermal.lua +++ b/technic/machines/LV/geothermal.lua @@ -10,9 +10,9 @@ local S = technic.getter minetest.register_craft({ output = 'technic:geothermal', recipe = { - {technic.compat.granite_ingredient, technic.compat.diamond_ingredient, technic.compat.granite_ingredient}, + {technic_compat.granite_ingredient, technic_compat.diamond_ingredient, technic_compat.granite_ingredient}, {'basic_materials:copper_wire', 'technic:machine_casing', 'basic_materials:copper_wire'}, - {technic.compat.granite_ingredient, 'technic:lv_cable', technic.compat.granite_ingredient}, + {technic_compat.granite_ingredient, 'technic:lv_cable', technic_compat.granite_ingredient}, }, replacements = { {"basic_materials:copper_wire", "basic_materials:empty_spool"}, @@ -90,7 +90,7 @@ minetest.register_node("technic:geothermal", { technic_machine=1, technic_lv=1, pickaxey=3}, paramtype2 = "facedir", legacy_facedir_simple = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Geothermal %s Generator"):format("LV")) @@ -111,7 +111,7 @@ minetest.register_node("technic:geothermal_active", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1, pickaxey=3}, legacy_facedir_simple = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, drop = "technic:geothermal", technic_run = run, _mcl_hardness = 3, diff --git a/technic/machines/LV/grinder.lua b/technic/machines/LV/grinder.lua index ff42911..454f169 100644 --- a/technic/machines/LV/grinder.lua +++ b/technic/machines/LV/grinder.lua @@ -3,9 +3,9 @@ minetest.register_alias("grinder", "technic:lv_grinder") minetest.register_craft({ output = 'technic:lv_grinder', recipe = { - {technic.compat.desert_stone_ingredient, technic.compat.diamond_ingredient, technic.compat.desert_stone_ingredient}, - {technic.compat.desert_stone_ingredient, 'technic:machine_casing', technic.compat.desert_stone_ingredient}, - {technic.compat.granite_ingredient, 'technic:lv_cable', technic.compat.granite_ingredient}, + {technic_compat.desert_stone_ingredient, technic_compat.diamond_ingredient, technic_compat.desert_stone_ingredient}, + {technic_compat.desert_stone_ingredient, 'technic:machine_casing', technic_compat.desert_stone_ingredient}, + {technic_compat.granite_ingredient, 'technic:lv_cable', technic_compat.granite_ingredient}, } }) diff --git a/technic/machines/LV/lamp.lua b/technic/machines/LV/lamp.lua index 1ef2bf4..cefaec7 100644 --- a/technic/machines/LV/lamp.lua +++ b/technic/machines/LV/lamp.lua @@ -161,7 +161,7 @@ technic.register_machine("LV", "technic:lv_lamp_active", technic.receiver) minetest.register_craft({ output = "technic:lv_lamp", recipe = { - {technic.compat.glass_ingredient, technic.compat.glass_ingredient, technic.compat.glass_ingredient}, + {technic_compat.glass_ingredient, technic_compat.glass_ingredient, technic_compat.glass_ingredient}, {"technic:lv_led", "technic:lv_led", "technic:lv_led"}, {"mesecons_materials:glue", "technic:lv_cable", "mesecons_materials:glue"}, } diff --git a/technic/machines/LV/music_player.lua b/technic/machines/LV/music_player.lua index a46687c..e2d2761 100644 --- a/technic/machines/LV/music_player.lua +++ b/technic/machines/LV/music_player.lua @@ -7,9 +7,9 @@ minetest.register_alias("music_player", "technic:music_player") minetest.register_craft({ output = 'technic:music_player', recipe = { - {'technic:chromium_ingot', technic.compat.diamond_ingredient, 'technic:chromium_ingot'}, - {technic.compat.diamond_ingredient, 'technic:machine_casing', technic.compat.diamond_ingredient}, - {technic.compat.mossy_cobble_ingredient, 'technic:lv_cable', technic.compat.mossy_cobble_ingredient}, + {'technic:chromium_ingot', technic_compat.diamond_ingredient, 'technic:chromium_ingot'}, + {technic_compat.diamond_ingredient, 'technic:machine_casing', technic_compat.diamond_ingredient}, + {technic_compat.mossy_cobble_ingredient, 'technic:lv_cable', technic_compat.mossy_cobble_ingredient}, } }) @@ -96,7 +96,7 @@ minetest.register_node("technic:music_player", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1, pickaxey=3}, connect_sides = {"bottom"}, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("%s Music Player"):format("LV")) diff --git a/technic/machines/LV/solar_panel.lua b/technic/machines/LV/solar_panel.lua index 161ee8f..f7684bf 100644 --- a/technic/machines/LV/solar_panel.lua +++ b/technic/machines/LV/solar_panel.lua @@ -50,7 +50,7 @@ minetest.register_node("technic:solar_panel", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1, pickaxey=3}, connect_sides = {"bottom"}, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, description = S("Small Solar %s Generator"):format("LV"), active = false, drawtype = "nodebox", diff --git a/technic/machines/LV/water_mill.lua b/technic/machines/LV/water_mill.lua index b59d133..4250108 100644 --- a/technic/machines/LV/water_mill.lua +++ b/technic/machines/LV/water_mill.lua @@ -11,7 +11,7 @@ minetest.register_alias("water_mill", "technic:water_mill") minetest.register_craft({ output = 'technic:water_mill', recipe = { - {'technic:marble', technic.compat.diamond_ingredient, 'technic:marble'}, + {'technic:marble', technic_compat.diamond_ingredient, 'technic:marble'}, {'group:wood', 'technic:machine_casing', 'group:wood'}, {'technic:marble', 'technic:lv_cable', 'technic:marble'}, } @@ -80,7 +80,7 @@ minetest.register_node("technic:water_mill", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1, pickaxey=3}, legacy_facedir_simple = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Hydro %s Generator"):format("LV")) @@ -102,7 +102,7 @@ minetest.register_node("technic:water_mill_active", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1, pickaxey=3}, legacy_facedir_simple = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, drop = "technic:water_mill", technic_run = run, technic_disabled_machine_name = "technic:water_mill", diff --git a/technic/machines/MV/hydro_turbine.lua b/technic/machines/MV/hydro_turbine.lua index 6b05edf..d006b29 100644 --- a/technic/machines/MV/hydro_turbine.lua +++ b/technic/machines/MV/hydro_turbine.lua @@ -77,7 +77,7 @@ minetest.register_node("technic:hydro_turbine", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_mv=1, pickaxey=3}, legacy_facedir_simple = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Hydro %s Generator"):format("MV")) @@ -99,7 +99,7 @@ minetest.register_node("technic:hydro_turbine_active", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_mv=1, not_in_creative_inventory=1, pickaxey=3}, legacy_facedir_simple = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, drop = "technic:hydro_turbine", technic_run = run, technic_disabled_machine_name = "technic:hydro_turbine", diff --git a/technic/machines/MV/lighting.lua b/technic/machines/MV/lighting.lua index c4913af..9372c67 100644 --- a/technic/machines/MV/lighting.lua +++ b/technic/machines/MV/lighting.lua @@ -105,7 +105,7 @@ minetest.register_node('technic:homedecor_glowlight_half_yellow', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -145,7 +145,7 @@ minetest.register_node('technic:homedecor_glowlight_half_yellow_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_half_yellow", @@ -186,7 +186,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_yellow', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -226,7 +226,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_yellow_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX-1, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_quarter_yellow", @@ -268,7 +268,7 @@ minetest.register_node('technic:homedecor_glowlight_half_white', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -308,7 +308,7 @@ minetest.register_node('technic:homedecor_glowlight_half_white_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_half_white", @@ -349,7 +349,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_white', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -389,7 +389,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_white_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX-1, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_quarter_white", @@ -430,7 +430,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_yellow', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -470,7 +470,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_yellow_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX-1, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_small_cube_yellow", @@ -511,7 +511,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_white', { paramtype = "light", paramtype2 = "facedir", walkable = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, groups = { snappy = 3 }, on_place = function(itemstack, placer, pointed_thing) @@ -551,7 +551,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_white_active', { paramtype2 = "facedir", walkable = true, light_source = minetest.LIGHT_MAX-1, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, groups = { snappy = 3, not_in_creative_inventory=1}, drop="technic:homedecor_glowlight_small_cube_white", diff --git a/technic/machines/MV/power_radiator.lua b/technic/machines/MV/power_radiator.lua index 993f8b2..b9d6a25 100644 --- a/technic/machines/MV/power_radiator.lua +++ b/technic/machines/MV/power_radiator.lua @@ -123,7 +123,7 @@ minetest.register_node("technic:power_radiator", { tiles = {"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png"}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, pickaxey=3}, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, drawtype = "nodebox", paramtype = "light", is_ground_content = true, diff --git a/technic/machines/MV/tool_workshop.lua b/technic/machines/MV/tool_workshop.lua index ad44a45..afd0822 100644 --- a/technic/machines/MV/tool_workshop.lua +++ b/technic/machines/MV/tool_workshop.lua @@ -10,9 +10,9 @@ local tube_entry = "^pipeworks_tube_connection_wooden.png" minetest.register_craft({ output = 'technic:tool_workshop', recipe = { - {'group:wood', technic.compat.diamond_ingredient, 'group:wood'}, + {'group:wood', technic_compat.diamond_ingredient, 'group:wood'}, {'mesecons_pistons:piston_sticky_off', 'technic:machine_casing', 'technic:carbon_cloth'}, - {technic.compat.obsidian_ingredient, 'technic:mv_cable', technic.compat.obsidian_ingredient}, + {technic_compat.obsidian_ingredient, 'technic:mv_cable', technic_compat.obsidian_ingredient}, } }) @@ -95,7 +95,7 @@ minetest.register_node("technic:tool_workshop", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_mv=1, tubedevice=1, tubedevice_receiver=1, pickaxey=3}, connect_sides = {"bottom", "back", "left", "right"}, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("%s Tool Workshop"):format("MV")) diff --git a/technic/machines/MV/wind_mill.lua b/technic/machines/MV/wind_mill.lua index 7b80024..3a82574 100644 --- a/technic/machines/MV/wind_mill.lua +++ b/technic/machines/MV/wind_mill.lua @@ -25,7 +25,7 @@ minetest.register_node("technic:wind_mill_frame", { tiles = {"technic_carbon_steel_block.png", "default_glass.png"}, sunlight_propagates = true, groups = {cracky=3, pickaxey=3}, - sounds = technic.compat.stone_sounds, + sounds = technic_compat.stone_sounds, paramtype = "light", _mcl_hardness = 3, _mcl_blast_resistance = 3, @@ -76,7 +76,7 @@ minetest.register_node("technic:wind_mill", { paramtype2 = "facedir", groups = {cracky=1, technic_machine=1, technic_mv=1, pickaxey=3}, connect_sides = {"top", "bottom", "back", "left", "right"}, - sounds = technic.compat.stone_sounds, + sounds = technic_compat.stone_sounds, drawtype = "nodebox", paramtype = "light", node_box = { diff --git a/technic/machines/other/anchor.lua b/technic/machines/other/anchor.lua index c5496cc..4ed5a96 100644 --- a/technic/machines/other/anchor.lua +++ b/technic/machines/other/anchor.lua @@ -73,7 +73,7 @@ minetest.register_node("technic:admin_anchor", { tiles = {"technic_admin_anchor.png"}, is_ground_content = true, groups = {cracky=3, not_in_creative_inventory=1, pickaxey=3}, - sounds = technic.compat.stone_sounds, + sounds = technic_compat.stone_sounds, after_place_node = function (pos, placer) local meta = minetest.get_meta(pos) if placer and placer:is_player() then diff --git a/technic/machines/other/coal_alloy_furnace.lua b/technic/machines/other/coal_alloy_furnace.lua index 15e328a..4e2524b 100644 --- a/technic/machines/other/coal_alloy_furnace.lua +++ b/technic/machines/other/coal_alloy_furnace.lua @@ -6,9 +6,9 @@ local S = technic.getter minetest.register_craft({ output = 'technic:coal_alloy_furnace', recipe = { - {technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient}, - {technic.compat.brick_block_ingredient, '', technic.compat.brick_block_ingredient}, - {technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient}, + {technic_compat.brick_block_ingredient, technic_compat.brick_block_ingredient, technic_compat.brick_block_ingredient}, + {technic_compat.brick_block_ingredient, '', technic_compat.brick_block_ingredient}, + {technic_compat.brick_block_ingredient, technic_compat.brick_block_ingredient, technic_compat.brick_block_ingredient}, } }) @@ -36,7 +36,7 @@ minetest.register_node("technic:coal_alloy_furnace", { paramtype2 = "facedir", groups = {cracky=2, pickaxey=3}, legacy_facedir_simple = true, - sounds = technic.compat.stone_sounds, + sounds = technic_compat.stone_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("formspec", formspec) @@ -66,7 +66,7 @@ minetest.register_node("technic:coal_alloy_furnace_active", { drop = "technic:coal_alloy_furnace", groups = {cracky=2, not_in_creative_inventory=1, pickaxey=3}, legacy_facedir_simple = true, - sounds = technic.compat.stone_sounds, + sounds = technic_compat.stone_sounds, can_dig = technic.machine_can_dig, allow_metadata_inventory_put = technic.machine_inventory_put, allow_metadata_inventory_take = technic.machine_inventory_take, diff --git a/technic/machines/other/constructor.lua b/technic/machines/other/constructor.lua index 2b26fc0..6549838 100644 --- a/technic/machines/other/constructor.lua +++ b/technic/machines/other/constructor.lua @@ -142,7 +142,7 @@ local function make_constructor(mark, length) groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, mesecon = 2, technic_constructor = 1, pickaxey=3}, mesecons = {effector = {action_on = make_on(mark, length)}}, - sounds = technic.compat.stone_sounds, + sounds = technic_compat.stone_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) local formspec = "size[8,9;]".. @@ -198,7 +198,7 @@ local function make_constructor(mark, length) groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, mesecon=2, not_in_creative_inventory=1, technic_constructor=1, pickaxey = 3}, mesecons= {effector = {action_off = make_off(mark)}}, - sounds = technic.compat.stone_sounds, + sounds = technic_compat.stone_sounds, allow_metadata_inventory_put = allow_inventory_put, allow_metadata_inventory_take = technic.machine_inventory_take, allow_metadata_inventory_move = technic.machine_inventory_move, diff --git a/technic/machines/other/frames.lua b/technic/machines/other/frames.lua index cd0d224..200aa58 100644 --- a/technic/machines/other/frames.lua +++ b/technic/machines/other/frames.lua @@ -1000,7 +1000,7 @@ minetest.register_craft({ output = 'technic:template 10', recipe = { { '', 'basic_materials:brass_ingot', '' }, - { 'basic_materials:brass_ingot', technic.compat.mese_crystal_ingredient, 'basic_materials:brass_ingot' }, + { 'basic_materials:brass_ingot', technic_compat.mese_crystal_ingredient, 'basic_materials:brass_ingot' }, { '', 'basic_materials:brass_ingot', '' }, } }) @@ -1028,7 +1028,7 @@ minetest.register_craft({ output = 'technic:template_tool', recipe = { { '', 'technic:template', '' }, - { technic.compat.mese_crystal_ingredient, 'default:stick', technic.compat.mese_crystal_ingredient }, + { technic_compat.mese_crystal_ingredient, 'default:stick', technic_compat.mese_crystal_ingredient }, { '', 'default:stick', '' }, } }) diff --git a/technic/machines/other/injector.lua b/technic/machines/other/injector.lua index bd53c50..c1e7a06 100644 --- a/technic/machines/other/injector.lua +++ b/technic/machines/other/injector.lua @@ -47,7 +47,7 @@ minetest.register_craft({ output = 'technic:injector 1', recipe = { {'', 'technic:control_logic_unit',''}, - {'', technic.compat.chest_ingredient,''}, + {'', technic_compat.chest_ingredient,''}, {'', 'pipeworks:tube_1',''}, } }) @@ -105,7 +105,7 @@ minetest.register_node("technic:injector", { end, connect_sides = {left=1, right=1, back=1, top=1, bottom=1}, }, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Self-Contained Injector")) diff --git a/technic/machines/power_monitor.lua b/technic/machines/power_monitor.lua index 0baefa7..e207be6 100644 --- a/technic/machines/power_monitor.lua +++ b/technic/machines/power_monitor.lua @@ -10,7 +10,7 @@ minetest.register_craft({ output = "technic:power_monitor", recipe = { {"", "", ""}, - {"", "technic:machine_casing", technic.compat.copper_ingredient}, + {"", "technic:machine_casing", technic_compat.copper_ingredient}, {"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"} } }) @@ -28,7 +28,7 @@ minetest.register_node("technic:power_monitor",{ paramtype2 = "facedir", groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1, technic_machine=1,pickaxey=3}, connect_sides = {"bottom", "back"}, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Power Monitor")) diff --git a/technic/machines/register/battery_box.lua b/technic/machines/register/battery_box.lua index a427e06..822a88d 100644 --- a/technic/machines/register/battery_box.lua +++ b/technic/machines/register/battery_box.lua @@ -17,9 +17,9 @@ technic.register_power_tool("technic:blue_energy_crystal", 450000) minetest.register_craft({ output = "technic:battery", recipe = { - {"group:wood", technic.compat.copper_ingredient, "group:wood"}, + {"group:wood", technic_compat.copper_ingredient, "group:wood"}, {"group:wood", "default:tin_ingot", "group:wood"}, - {"group:wood", technic.compat.copper_ingredient, "group:wood"}, + {"group:wood", technic_compat.copper_ingredient, "group:wood"}, } }) -- Sulfur-lead-water recipes: @@ -300,7 +300,7 @@ function technic.register_battery_box(data) connect_sides = {"bottom"}, tube = data.tube and tube or nil, paramtype2 = "facedir", - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, drop = "technic:"..ltier.."_battery_box0", on_construct = function(pos) local meta = minetest.get_meta(pos) diff --git a/technic/machines/register/cables.lua b/technic/machines/register/cables.lua index a35b001..51af47d 100644 --- a/technic/machines/register/cables.lua +++ b/technic/machines/register/cables.lua @@ -161,7 +161,7 @@ function technic.register_cable(tier, size) inventory_image = "technic_"..ltier.."_cable_wield.png", wield_image = "technic_"..ltier.."_cable_wield.png", groups = groups, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, drop = "technic:"..ltier.."_cable", paramtype = "light", sunlight_propagates = true, @@ -203,7 +203,7 @@ function technic.register_cable(tier, size) description = S("%s Cable Plate"):format(tier), tiles = {"technic_"..ltier.."_cable.png"}, groups = table.copy(groups), - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, drop = "technic:"..ltier.."_cable_plate_1", paramtype = "light", sunlight_propagates = true, diff --git a/technic/machines/register/common.lua b/technic/machines/register/common.lua index 4bb5178..c09a8c6 100644 --- a/technic/machines/register/common.lua +++ b/technic/machines/register/common.lua @@ -35,7 +35,7 @@ end -- handles the machine upgrades when set or removed local function on_machine_upgrade(meta, stack) local stack_name = stack:get_name() - if stack_name == technic.compat.chest_ingredient then + if stack_name == technic_compat.chest_ingredient then meta:set_int("public", 1) return 1 elseif stack_name ~= "technic:control_logic_unit" @@ -47,7 +47,7 @@ end -- something is about to be removed local function on_machine_downgrade(meta, stack, list) - if stack:get_name() == technic.compat.chest_ingredient then + if stack:get_name() == technic_compat.chest_ingredient then local inv = meta:get_inventory() local upg1, upg2 = inv:get_stack("upgrade1", 1), inv:get_stack("upgrade2", 1) diff --git a/technic/machines/register/generator.lua b/technic/machines/register/generator.lua index 88e78d8..846a1a5 100644 --- a/technic/machines/register/generator.lua +++ b/technic/machines/register/generator.lua @@ -125,7 +125,7 @@ function technic.register_generator(data) groups = groups, connect_sides = {"bottom", "back", "left", "right"}, legacy_facedir_simple = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, tube = data.tube and tube or nil, on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -195,7 +195,7 @@ function technic.register_generator(data) groups = active_groups, connect_sides = {"bottom"}, legacy_facedir_simple = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, tube = data.tube and tube or nil, drop = "technic:"..ltier.."_generator", can_dig = technic.machine_can_dig, diff --git a/technic/machines/register/grinder_recipes.lua b/technic/machines/register/grinder_recipes.lua index 2017aef..22ead6f 100644 --- a/technic/machines/register/grinder_recipes.lua +++ b/technic/machines/register/grinder_recipes.lua @@ -82,15 +82,15 @@ 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", technic.compat.copper_ingredient) +register_dust("Copper", technic_compat.copper_ingredient) register_dust("Lead", "technic:lead_ingot") -register_dust("Gold", technic.compat.gold_ingot_ingredient) +register_dust("Gold", technic_compat.gold_ingot_ingredient) 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", technic.compat.tin_ingredient) +register_dust("Tin", technic_compat.tin_ingredient) 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 diff --git a/technic/machines/register/machine_base.lua b/technic/machines/register/machine_base.lua index 5227955..c69ab6c 100644 --- a/technic/machines/register/machine_base.lua +++ b/technic/machines/register/machine_base.lua @@ -174,7 +174,7 @@ function technic.register_base_machine(data) tube = data.tube and tube or nil, connect_sides = data.connect_sides or connect_default, legacy_facedir_simple = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, on_construct = function(pos) local node = minetest.get_node(pos) local meta = minetest.get_meta(pos) @@ -248,7 +248,7 @@ function technic.register_base_machine(data) groups = active_groups, connect_sides = data.connect_sides or connect_default, legacy_facedir_simple = true, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, tube = data.tube and tube or nil, can_dig = technic.machine_can_dig, allow_metadata_inventory_put = technic.machine_inventory_put, diff --git a/technic/machines/register/solar_array.lua b/technic/machines/register/solar_array.lua index ca60ca8..1469467 100644 --- a/technic/machines/register/solar_array.lua +++ b/technic/machines/register/solar_array.lua @@ -45,7 +45,7 @@ function technic.register_solar_array(data) "technic_"..ltier.."_solar_array_side.png", "technic_"..ltier.."_solar_array_side.png"}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, ["technic_"..ltier]=1, pickaxey=3}, connect_sides = {"bottom"}, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, description = S("Arrayed Solar %s Generator"):format(tier), active = false, drawtype = "nodebox", diff --git a/technic/machines/supply_converter.lua b/technic/machines/supply_converter.lua index bb3c380..f42e23d 100644 --- a/technic/machines/supply_converter.lua +++ b/technic/machines/supply_converter.lua @@ -200,7 +200,7 @@ minetest.register_node("technic:supply_converter", { groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, technic_all_tiers=1, pickaxey=3}, connect_sides = {"top", "bottom"}, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, on_receive_fields = supply_converter_receive_fields, on_construct = function(pos) local meta = minetest.get_meta(pos) diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua index 75140ea..0f3e7a6 100644 --- a/technic/machines/switching_station.lua +++ b/technic/machines/switching_station.lua @@ -15,7 +15,7 @@ minetest.register_craft({ output = "technic:switching_station", recipe = { {"", "technic:lv_transformer", ""}, - {technic.compat.copper_ingredient, "technic:machine_casing", technic.compat.copper_ingredient}, + {technic_compat.copper_ingredient, "technic:machine_casing", technic_compat.copper_ingredient}, {"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"} } }) @@ -38,7 +38,7 @@ minetest.register_node("technic:switching_station",{ "technic_water_mill_top_active.png"}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1,pickaxey=3}, connect_sides = {"bottom"}, - sounds = technic.compat.wood_sounds, + sounds = technic_compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Switching Station")) diff --git a/technic/mcl_craftguide.lua b/technic/mcl_craftguide.lua deleted file mode 100644 index d9da5d4..0000000 --- a/technic/mcl_craftguide.lua +++ /dev/null @@ -1,188 +0,0 @@ --- Register craft types for each machine -mcl_craftguide.register_craft_type("centrifuge", { - description = "Centrifuge", - icon = "technic_mv_centrifuge_front_active.png", -}) - -mcl_craftguide.register_craft_type("compressor", { - description = "Compressor", - icon = "technic_lv_compressor_front_active.png", -}) - -mcl_craftguide.register_craft_type("extractor", { - description = "Extractor", - icon = "technic_lv_extractor_front_active.png", -}) - -mcl_craftguide.register_craft_type("freezer", { - description = "Freezer", - icon = "technic_mv_freezer_front_active.png", -}) - -mcl_craftguide.register_craft_type("grinder", { - description = "Grinder", - icon = "technic_lv_grinder_front_active.png", -}) - -mcl_craftguide.register_craft_type("alloy_furnace", { - description = "Alloy Furnace", - icon = "technic_coal_alloy_furnace_front_active.png", -}) - - -centrifuge_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", technic.compat.sand_ingredient, "technic:uranium3_dust" }, - { technic.compat.dirt_ingredient.." 4", technic.compat.sand_ingredient, technic.compat.gravel_ingredient, "default:clay_lump 2" }, -} - -compressor_recipes = { - {technic.compat.snow_block_ingredient, technic.compat.ice_block_ingredient}, - {technic.compat.sand_ingredient.." 2", technic.compat.sandstone_ingredient}, - {technic.compat.desert_sand_ingredient.." 2", technic.compat.desert_stone_ingredient}, - {technic.compat.desert_sand_ingredient, technic.compat.desert_stone_ingredient}, - {"technic:mixed_metal_ingot", "technic:composite_plate"}, - {technic.compat.copper_ingredient.." 5", "technic:copper_plate"}, - {"technic:coal_dust 4", "technic:graphite"}, - {"technic:carbon_cloth", "technic:carbon_plate"}, - {"technic:uranium35_ingot 5", "technic:uranium_fuel"}, -} - -extractor_recipes = { - {"technic:coal_dust", technic.compat.dye_black .. " 2"}, - {technic.compat.blueberries_ingredient, technic.compat.dye_violet .. " 2"}, - {technic.compat.grass_ingredient, technic.compat.dye_green .. " 1"}, - {technic.compat.dry_shrub_ingredient, technic.compat.dye_brown .. " 1"}, - {technic.compat.junglegrass_ingredient, technic.compat.dye_green .. " 2"}, - {technic.compat.cactus_ingredient, technic.compat.dye_green .. " 4"}, - {technic.compat.geranium_ingredient, technic.compat.dye_blue .. " 4"}, - {technic.compat.dandelion_white_ingredient, technic.compat.dye_white .. " 4"}, - {technic.compat.dandelion_yellow_ingredient, technic.compat.dye_yellow .. " 4"}, - {technic.compat.tulip_ingredient, technic.compat.dye_orange .. " 4"}, - {technic.compat.rose_ingredient, technic.compat.dye_red .. " 4"}, - {technic.compat.viola_ingredient, technic.compat.dye_violet .. " 4"}, - {technic.compat.blackberry_ingredient, unifieddyes and "unifieddyes:magenta_s50 4" or technic.compat.dye_violet .. " 4"}, - {technic.compat.blueberry_ingredient, unifieddyes and "unifieddyes:magenta_s50 4" or ""}, -} - -freezer_recipes = { - {technic.compat.water_bucket_ingredient, { technic.compat.ice_block_ingredient, technic.compat.emtpy_bucket_ingredient } }, - {technic.compat.bucket_river_water_ingredient, { technic.compat.ice_block_ingredient, technic.compat.emtpy_bucket_ingredient } }, - {technic.compat.dirt_ingredient , technic.compat.dirt_with_snow_ingredient }, - {technic.compat.bucket_lava_ingredient, { technic.compat.obsidian_ingredient, technic.compat.emtpy_bucket_ingredient } } -} - -grinder_recipes = { - -- Dusts - {technic.compat.coal_ingredient, "technic:coal_dust 2"}, - {technic.compat.copper_lump_ingredient, "technic:copper_dust 2"}, - {technic.compat.desert_stone_ingredient, technic.compat.desert_sand_ingredient}, - {technic.compat.gold_lump_ingredient, "technic:gold_dust 2"}, - {technic.compat.iron_lump_ingredient, "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"}, - {technic.compat.stone_ingredient, "technic:stone_dust"}, - {technic.compat.sand_ingredient, "technic:stone_dust"}, - {technic.compat.desert_sand_ingredient, "technic:stone_dust"}, - - -- Other - {technic.compat.cobble_ingredient, technic.compat.gravel_ingredient}, - {technic.compat.gravel_ingredient, technic.compat.sand_ingredient}, - {technic.compat.sandstone_ingredient, technic.compat.sand_ingredient.." 2"}, -- reverse recipe can be found in the compressor - {technic.compat.desert_stone_ingredient, technic.compat.desert_sand_ingredient.." 2"}, -- reverse recipe can be found in the compressor - {technic.compat.ice_block_ingredient, technic.compat.snow_block_ingredient}, -} - -alloy_recipes = { - {"technic:copper_dust 7", "technic:tin_dust", "technic:bronze_dust 8", 12}, - {technic.compat.copper_ingredient.." 7", technic.compat.tin_ingredient, technic.compat.bronze_ingredient.." 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}, - {"technic:carbon_steel_ingot 2", "technic:coal_dust", "technic:cast_iron_ingot 2", 6}, - {"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"}, - {technic.compat.copper_ingredient.." 2", "technic:zinc_ingot", "basic_materials:brass_ingot 3"}, - {technic.compat.sand_ingredient.." 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}, - {technic.compat.ice_block_ingredient, technic.compat.emtpy_bucket_ingredient, technic.compat.water_bucket_ingredient, 1 }, -} - -for _, data in pairs(alloy_recipes) do - mcl_craftguide.register_craft({ - type = "alloy_furnace", - width = 1, - output = data[3], - items = {data[1], data[2]}, - }) -end - --- Register Centrifuge Recipes -for _, data in pairs(centrifuge_recipes) do - mcl_craftguide.register_craft({ - type = "centrifuge", - width = 1, - output = table.concat({data[2], data[3], data[4]}, " "), - items = {data[1]}, - }) -end - --- Register Compressor Recipes -for _, data in pairs(compressor_recipes) do - mcl_craftguide.register_craft({ - type = "compressor", - width = 1, - output = data[2], - items = {data[1]}, - }) -end - --- Register Extractor Recipes -for _, data in ipairs(extractor_recipes) do - mcl_craftguide.register_craft({ - type = "extractor", - width = 1, - output = data[2], - items = {data[1]}, - }) -end - --- Register Freezer Recipes -for _, data in pairs(freezer_recipes) do - local output_string - if type(data[2]) == "table" then - output_string = table.concat(data[2], ", ") - else - output_string = data[2] - end - - mcl_craftguide.register_craft({ - type = "freezer", - width = 1, - output = output_string, - items = {data[1]}, - }) -end - - --- Register Grinder Recipes -for _, data in pairs(grinder_recipes) do - mcl_craftguide.register_craft({ - type = "grinder", - width = 1, - output = data[2], - items = {data[1]}, - }) -end - diff --git a/technic/mcl_support.lua b/technic/mcl_support.lua deleted file mode 100644 index 274176e..0000000 --- a/technic/mcl_support.lua +++ /dev/null @@ -1,110 +0,0 @@ -local default = minetest.get_modpath("default") and default or {} -local mcl = minetest.get_modpath("mcl_core") - --- Compatibility table -technic.compat = {} - --- Helper function to set compatibility variables -local function set_compat(mcl_value, default_value) - return mcl and mcl_value or default_value -end - --- Mineclone2 Support -technic.compat.stone_sounds = mcl and mcl_sounds.node_sound_stone_defaults() or default.node_sound_stone_defaults() -technic.compat.mt_light_max = mcl and mcl_core.LIGHT_MAX or default.LIGHT_MAX -technic.compat.copper_ingredient = mcl and "mcl_copper:copper_ingot" or 'default:copper_ingot' -technic.compat.iron_ingredient = mcl and "mcl_core:iron_ingot" or 'default:steel_ingot' -technic.compat.iron_lump_ingredient = mcl and "mcl_raw_ores:raw_iron" or 'default:iron_lump' -technic.compat.gold_lump_ingredient = mcl and "mcl_raw_ores:raw_gold" or 'default:gold_lump' -technic.compat.copper_lump_ingredient = mcl and "mcl_copper:raw_copper" or 'default:copper_lump' -technic.compat.mese_crystal_ingredient = mcl and "mesecons:wire_00000000_off" or 'default:mese_crystal' -technic.compat.diamond_ingredient = mcl and "mcl_core:diamond" or 'default:diamond' -technic.compat.glass_ingredient = mcl and "mcl_core:glass" or 'default:glass' -technic.compat.brick_block_ingredient = mcl and "mcl_core:brick_block" or 'default:brick' -technic.compat.mese_block_ingredient = mcl and "mesecons_torch:redstoneblock" or "default:mese" -technic.compat.paper_ingredient = mcl and "mcl_core:paper" or 'default:paper' -technic.compat.obsidian_glass_ingredient = mcl and "mcl_core:obsidian" or 'default:obsidian_glass' -technic.compat.obsidian_ingredient = mcl and "mcl_core:obsidian" or 'default:obsidian' -technic.compat.green_dye_ingredient = mcl and "mcl_dye:green" or 'dye:green' -technic.compat.blue_dye_ingredient = mcl and "mcl_dye:blue" or 'dye:blue' -technic.compat.red_dye_ingredient = mcl and "mcl_dye:red" or 'dye:red' -technic.compat.white_dye_ingredient = mcl and "mcl_dye:white" or 'dye:white' -technic.compat.gold_ingot_ingredient = mcl and "mcl_core:gold_ingot" or 'default:gold_ingot' -technic.compat.chest_ingredient = mcl and "mcl_chests:chest" or "default:chest" -technic.compat.stone_ingredient = mcl and "mcl_core:stone" or "default:stone" -technic.compat.wood_fence_ingredient = mcl and "group:fence_wood" or "default:fence_wood" -technic.compat.diamond_ingredient = mcl and "mcl_core:diamond" or "default:diamond" -technic.compat.bronze_ingredient = mcl and "mcl_copper:copper_ingot" or 'default:bronze_ingot' -technic.compat.tin_ingredient = mcl and "moreores:tin_ingot" or 'default:tin_ingot' -technic.compat.sandstone_ingredient = mcl and "mcl_core:sandstone" or 'default:desert_stone' -technic.compat.sand_ingredient = mcl and "mcl_core:sand" or 'default:sand' -technic.compat.gravel_ingredient = mcl and "mcl_core:gravel" or 'default:gravel' -technic.compat.desert_stone_ingredient = mcl and "mcl_core:redsandstone" or 'default:desert_stone' -technic.compat.desert_sand_ingredient = mcl and "mcl_core:redsand" or 'default:desert_sand' -technic.compat.furnace_ingredient = mcl and "mcl_furnaces:furnace" or 'default:furnace' -technic.compat.mossy_cobble_ingredient = mcl and "mcl_core:mossycobble" or 'default:mossycobble' -technic.compat.cobble_ingredient = mcl and "mcl_core:cobble" or 'default:cobble' -technic.compat.snow_block_ingredient = mcl and "mcl_core:snowblock" or 'default:snowblock' -technic.compat.ice_block_ingredient = mcl and "mcl_core:ice" or 'default:ice' -technic.compat.granite_ingredient = mcl and "mcl_core:granite" or 'technic:granite' -technic.compat.granite_bricks_ingredient = mcl and "mcl_core:granite_smooth" or 'technic:granite_bricks' -technic.compat.coal_ingredient = mcl and "group:coal" or "default:coal_lump" -technic.compat.dirt_ingredient = mcl and "mcl_core:dirt" or "default:dirt" -technic.compat.mesecons_fiber_ingredient = mcl and "mesecons:wire_00000000_off" or "mesecons_materials:fiber" -technic.compat.stick_ingredient = mcl and "mcl_core:stick" or "default:stick" -technic.compat.emtpy_bucket_ingredient = mcl and "mcl_buckets:bucket_empty" or "bucket:bucket_empty" -technic.compat.water_bucket_ingredient = mcl and "mcl_buckets:bucket_water" or "bucket:bucket_water" - --- Ingredient Variables -if mcl then - technic.compat.blueberries_ingredient = "mcl_farming:blueberries" - technic.compat.grass_ingredient = "mcl_core:grass" - technic.compat.dry_shrub_ingredient = "mcl_core:deadbush" - technic.compat.junglegrass_ingredient = "mcl_core:tallgrass" - technic.compat.cactus_ingredient = "mcl_core:cactus" - technic.compat.geranium_ingredient = "mcl_flowers:blue_orchid" - technic.compat.dandelion_white_ingredient = "mcl_flowers:oxeye_daisy" - technic.compat.dandelion_yellow_ingredient = "mcl_flowers:dandelion" - technic.compat.tulip_ingredient = "mcl_flowers:orange_tulip" - technic.compat.rose_ingredient = "mcl_flowers:poppy" - technic.compat.viola_ingredient = "mcl_flowers:allium" -else - technic.compat.blueberries_ingredient = "default:blueberries" - technic.compat.grass_ingredient = "default:grass_1" - technic.compat.dry_shrub_ingredient = "default:dry_shrub" - technic.compat.junglegrass_ingredient = "default:junglegrass" - technic.compat.cactus_ingredient = "default:cactus" - technic.compat.geranium_ingredient = "flowers:geranium" - technic.compat.dandelion_white_ingredient = "flowers:dandelion_white" - technic.compat.dandelion_yellow_ingredient = "flowers:dandelion_yellow" - technic.compat.tulip_ingredient = "flowers:tulip" - technic.compat.rose_ingredient = "flowers:rose" - technic.compat.viola_ingredient = "flowers:viola" -end - --- Dye Output Variables -if mcl then - technic.compat.dye_black = "mcl_dye:black" - technic.compat.dye_violet = "mcl_dye:violet" - technic.compat.dye_green = "mcl_dye:green" - technic.compat.dye_brown = "mcl_dye:brown" - technic.compat.dye_blue = "mcl_dye:blue" - technic.compat.dye_white = "mcl_dye:white" - technic.compat.dye_yellow = "mcl_dye:yellow" - technic.compat.dye_orange = "mcl_dye:orange" - technic.compat.dye_red = "mcl_dye:red" -else - technic.compat.dye_black = "dye:black" - technic.compat.dye_violet = "dye:violet" - technic.compat.dye_green = "dye:green" - technic.compat.dye_brown = "dye:brown" - technic.compat.dye_blue = "dye:blue" - technic.compat.dye_white = "dye:white" - technic.compat.dye_yellow = "dye:yellow" - technic.compat.dye_orange = "dye:orange" - technic.compat.dye_red = "dye:red" -end - -technic.compat.dirt_with_snow_ingredient = mcl and "mcl_core:dirt_with_grass_snow" or "default:dirt_with_snow" -technic.compat.bucket_lava_ingredient = mcl and "mcl_buckets:bucket_lava" or "bucket:bucket_lava" -technic.compat.bucket_river_water_ingredient = mcl and "mcl_buckets:bucket_river_water" or "bucket:bucket_river_water" diff --git a/technic/mod.conf b/technic/mod.conf index 448cf74..70c92cb 100644 --- a/technic/mod.conf +++ b/technic/mod.conf @@ -1,4 +1,4 @@ name = technic -depends = pipeworks, technic_worldgen, basic_materials +depends = pipeworks, technic_worldgen, basic_materials, technic_compat optional_depends = bucket, default, screwdriver, mesecons,mesecons_torch, mesecons_mvps, digilines, digiline_remote, intllib, unified_inventory, vector_extras, dye, craftguide,i3, mcl_core, mcl_craftguide supported_games = minetest_game,mineclone2,mineclonia,mineclone5 \ No newline at end of file diff --git a/technic/radiation.lua b/technic/radiation.lua index 814be14..bd19570 100644 --- a/technic/radiation.lua +++ b/technic/radiation.lua @@ -52,7 +52,7 @@ local rad_resistance_node = { ["default:ice"] = 5.6, ["default:lava_flowing"] = 8.5, ["default:lava_source"] = 17, - [technic.compat.mese_block_ingredient] = 21, + [technic_compat.mese_block_ingredient] = 21, ["default:mossycobble"] = 15, ["default:tinblock"] = 37, ["pbj_pup:pbj_pup"] = 10000, @@ -64,7 +64,7 @@ local rad_resistance_node = { ["nyancat:nyancat"] = 10000, ["nyancat:nyancat_rainbow"] = 10000, ["default:obsidian"] = 18, - [technic.compat.obsidian_glass_ingredient] = 18, + [technic_compat.obsidian_glass_ingredient] = 18, ["default:sand"] = 10, ["default:sandstone"] = 15, ["default:sandstonebrick"] = 15, @@ -153,7 +153,7 @@ local rad_resistance_node = { ["technic:chromium_block"] = 37, ["technic:corium_flowing"] = 40, ["technic:corium_source"] = 80, - [technic.compat.granite_ingredient] = 18, + [technic_compat.granite_ingredient] = 18, ["technic:lead_block"] = 80, ["technic:marble"] = 18, ["technic:marble_bricks"] = 18, @@ -457,7 +457,7 @@ minetest.register_node("technic:chernobylite_block", { tiles = {"technic_chernobylite_block.png"}, is_ground_content = true, groups = {cracky=1, radioactive=4, level=2}, - sounds = technic.compat.stone_sounds, + sounds = technic_compat.stone_sounds, light_source = 2, }) diff --git a/technic/tools/cans.lua b/technic/tools/cans.lua index ef7f029..caeaebc 100644 --- a/technic/tools/cans.lua +++ b/technic/tools/cans.lua @@ -135,7 +135,7 @@ minetest.register_craft({ output = 'technic:river_water_can 1', recipe = { {'technic:zinc_ingot', 'technic:rubber', 'technic:zinc_ingot'}, - {technic.compat.iron_ingredient, '', technic.compat.iron_ingredient}, - {'technic:zinc_ingot', technic.compat.iron_ingredient, 'technic:zinc_ingot'}, + {technic_compat.iron_ingredient, '', technic_compat.iron_ingredient}, + {'technic:zinc_ingot', technic_compat.iron_ingredient, 'technic:zinc_ingot'}, } }) diff --git a/technic/tools/mining_drill.lua b/technic/tools/mining_drill.lua index e102e8f..f0543d1 100644 --- a/technic/tools/mining_drill.lua +++ b/technic/tools/mining_drill.lua @@ -6,9 +6,9 @@ local S = technic.getter minetest.register_craft({ output = 'technic:mining_drill', recipe = { - {technic.compat.tin_ingredient, 'technic:diamond_drill_head', technic.compat.tin_ingredient}, + {technic_compat.tin_ingredient, 'technic:diamond_drill_head', technic_compat.tin_ingredient}, {'technic:stainless_steel_ingot', 'basic_materials:motor', 'technic:stainless_steel_ingot'}, - {'', 'technic:red_energy_crystal', technic.compat.copper_ingredient}, + {'', 'technic:red_energy_crystal', technic_compat.copper_ingredient}, } }) minetest.register_craft({ diff --git a/technic/tools/mining_lasers.lua b/technic/tools/mining_lasers.lua index 596c8b6..3e38b4c 100644 --- a/technic/tools/mining_lasers.lua +++ b/technic/tools/mining_lasers.lua @@ -11,25 +11,25 @@ local S = technic.getter minetest.register_craft({ output = "technic:laser_mk1", recipe = { - {technic.compat.diamond_ingredient, "basic_materials:brass_ingot", technic.compat.obsidian_glass_ingredient}, + {technic_compat.diamond_ingredient, "basic_materials:brass_ingot", technic_compat.obsidian_glass_ingredient}, {"","basic_materials:brass_ingot", "technic:red_energy_crystal"}, - {"", "", technic.compat.copper_ingredient}, + {"", "", technic_compat.copper_ingredient}, } }) minetest.register_craft({ output = "technic:laser_mk2", recipe = { - {technic.compat.diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk1"}, + {technic_compat.diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk1"}, {"", "technic:carbon_steel_ingot", "technic:green_energy_crystal"}, - {"", "", technic.compat.copper_ingredient}, + {"", "", technic_compat.copper_ingredient}, } }) minetest.register_craft({ output = "technic:laser_mk3", recipe = { - {technic.compat.diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk2"}, + {technic_compat.diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk2"}, {"", "technic:carbon_steel_ingot", "technic:blue_energy_crystal"}, - {"", "", technic.compat.copper_ingredient}, + {"", "", technic_compat.copper_ingredient}, } }) diff --git a/technic/tools/sonic_screwdriver.lua b/technic/tools/sonic_screwdriver.lua index 024f78a..31d1d5c 100644 --- a/technic/tools/sonic_screwdriver.lua +++ b/technic/tools/sonic_screwdriver.lua @@ -90,9 +90,9 @@ minetest.register_tool("technic:sonic_screwdriver", { minetest.register_craft({ output = "technic:sonic_screwdriver", recipe = { - {"", technic.compat.diamond_ingredient, ""}, - {technic.compat.mesecons_fiber_ingredient, "technic:battery", technic.compat.mesecons_fiber_ingredient}, - {technic.compat.mesecons_fiber_ingredient, "moreores:mithril_ingot", technic.compat.mesecons_fiber_ingredient} + {"", technic_compat.diamond_ingredient, ""}, + {technic_compat.mesecons_fiber_ingredient, "technic:battery", technic_compat.mesecons_fiber_ingredient}, + {technic_compat.mesecons_fiber_ingredient, "moreores:mithril_ingot", technic_compat.mesecons_fiber_ingredient} } }) diff --git a/technic/tools/tree_tap.lua b/technic/tools/tree_tap.lua index 82e7872..d36190a 100644 --- a/technic/tools/tree_tap.lua +++ b/technic/tools/tree_tap.lua @@ -38,8 +38,8 @@ minetest.register_tool("technic:treetap", { minetest.register_craft({ output = "technic:treetap", recipe = { - {"pipeworks:tube_1", "group:wood", technic.compat.stick_ingredient}, - {"", technic.compat.stick_ingredient, technic.compat.stick_ingredient} + {"pipeworks:tube_1", "group:wood", technic_compat.stick_ingredient}, + {"", technic_compat.stick_ingredient, technic_compat.stick_ingredient} }, }) diff --git a/technic_chests/mod.conf b/technic_chests/mod.conf index 626a825..95a5877 100644 --- a/technic_chests/mod.conf +++ b/technic_chests/mod.conf @@ -1,4 +1,4 @@ name = technic_chests -depends = basic_materials +depends = basic_materials, technic_compat optional_depends = moreblocks, moreores, pipeworks, intllib, tubelib, default, mcl_core supported_games = minetest_game,mineclone2,mineclonia,mineclone5 \ No newline at end of file diff --git a/technic_cnc/mod.conf b/technic_cnc/mod.conf index b58bf3d..770d2ae 100644 --- a/technic_cnc/mod.conf +++ b/technic_cnc/mod.conf @@ -1,4 +1,4 @@ name = technic_cnc -depends = basic_materials +depends = basic_materials, technic_compat optional_depends = technic, default, mcl_core supported_games = minetest_game,mineclone2,mineclonia,mineclone5 \ No newline at end of file diff --git a/technic_compat/init.lua b/technic_compat/init.lua new file mode 100644 index 0000000..75122f3 --- /dev/null +++ b/technic_compat/init.lua @@ -0,0 +1,16 @@ +local modpath = minetest.get_modpath("technic_compat") + +-- Compatibility table +technic_compat = {} + +technic_compat.mcl = minetest.get_modpath("mcl_core") +technic_compat.default = minetest.get_modpath("default") and default or {} + +local mcl_path = modpath .. "/mcl/" + +-- Load files +dofile(mcl_path .. "sounds.lua") +dofile(mcl_path .. "textures.lua") +dofile(mcl_path .. "miscellaneous.lua") +dofile(mcl_path .. "crafting.lua") +dofile(mcl_path .. "craftguide.lua") diff --git a/technic_compat/mcl/craftguide.lua b/technic_compat/mcl/craftguide.lua new file mode 100644 index 0000000..9e64ed9 --- /dev/null +++ b/technic_compat/mcl/craftguide.lua @@ -0,0 +1,189 @@ +-- Register craft types for each machine +if technic_compat.mcl then + mcl_craftguide.register_craft_type("centrifuge", { + description = "Centrifuge", + icon = "technic_mv_centrifuge_front_active.png", + }) + + mcl_craftguide.register_craft_type("compressor", { + description = "Compressor", + icon = "technic_lv_compressor_front_active.png", + }) + + mcl_craftguide.register_craft_type("extractor", { + description = "Extractor", + icon = "technic_lv_extractor_front_active.png", + }) + + mcl_craftguide.register_craft_type("freezer", { + description = "Freezer", + icon = "technic_mv_freezer_front_active.png", + }) + + mcl_craftguide.register_craft_type("grinder", { + description = "Grinder", + icon = "technic_lv_grinder_front_active.png", + }) + + mcl_craftguide.register_craft_type("alloy_furnace", { + description = "Alloy Furnace", + icon = "technic_coal_alloy_furnace_front_active.png", + }) + + + centrifuge_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", technic_compat.sand_ingredient, "technic:uranium3_dust" }, + { technic_compat.dirt_ingredient.." 4", technic_compat.sand_ingredient, technic_compat.gravel_ingredient, "default:clay_lump 2" }, + } + + compressor_recipes = { + {technic_compat.snow_block_ingredient, technic_compat.ice_block_ingredient}, + {technic_compat.sand_ingredient.." 2", technic_compat.sandstone_ingredient}, + {technic_compat.desert_sand_ingredient.." 2", technic_compat.desert_stone_ingredient}, + {technic_compat.desert_sand_ingredient, technic_compat.desert_stone_ingredient}, + {"technic:mixed_metal_ingot", "technic:composite_plate"}, + {technic_compat.copper_ingredient.." 5", "technic:copper_plate"}, + {"technic:coal_dust 4", "technic:graphite"}, + {"technic:carbon_cloth", "technic:carbon_plate"}, + {"technic:uranium35_ingot 5", "technic:uranium_fuel"}, + } + + extractor_recipes = { + {"technic:coal_dust", technic_compat.dye_black .. " 2"}, + {technic_compat.blueberries_ingredient, technic_compat.dye_violet .. " 2"}, + {technic_compat.grass_ingredient, technic_compat.dye_green .. " 1"}, + {technic_compat.dry_shrub_ingredient, technic_compat.dye_brown .. " 1"}, + {technic_compat.junglegrass_ingredient, technic_compat.dye_green .. " 2"}, + {technic_compat.cactus_ingredient, technic_compat.dye_green .. " 4"}, + {technic_compat.geranium_ingredient, technic_compat.dye_blue .. " 4"}, + {technic_compat.dandelion_white_ingredient, technic_compat.dye_white .. " 4"}, + {technic_compat.dandelion_yellow_ingredient, technic_compat.dye_yellow .. " 4"}, + {technic_compat.tulip_ingredient, technic_compat.dye_orange .. " 4"}, + {technic_compat.rose_ingredient, technic_compat.dye_red .. " 4"}, + {technic_compat.viola_ingredient, technic_compat.dye_violet .. " 4"}, + {technic_compat.blackberry_ingredient, unifieddyes and "unifieddyes:magenta_s50 4" or technic_compat.dye_violet .. " 4"}, + {technic_compat.blueberry_ingredient, unifieddyes and "unifieddyes:magenta_s50 4" or ""}, + } + + freezer_recipes = { + {technic_compat.water_bucket_ingredient, { technic_compat.ice_block_ingredient, technic_compat.emtpy_bucket_ingredient } }, + {technic_compat.bucket_river_water_ingredient, { technic_compat.ice_block_ingredient, technic_compat.emtpy_bucket_ingredient } }, + {technic_compat.dirt_ingredient , technic_compat.dirt_with_snow_ingredient }, + {technic_compat.bucket_lava_ingredient, { technic_compat.obsidian_ingredient, technic_compat.emtpy_bucket_ingredient } } + } + + grinder_recipes = { + -- Dusts + {technic_compat.coal_ingredient, "technic:coal_dust 2"}, + {technic_compat.copper_lump_ingredient, "technic:copper_dust 2"}, + {technic_compat.desert_stone_ingredient, technic_compat.desert_sand_ingredient}, + {technic_compat.gold_lump_ingredient, "technic:gold_dust 2"}, + {technic_compat.iron_lump_ingredient, "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"}, + {technic_compat.stone_ingredient, "technic:stone_dust"}, + {technic_compat.sand_ingredient, "technic:stone_dust"}, + {technic_compat.desert_sand_ingredient, "technic:stone_dust"}, + + -- Other + {technic_compat.cobble_ingredient, technic_compat.gravel_ingredient}, + {technic_compat.gravel_ingredient, technic_compat.sand_ingredient}, + {technic_compat.sandstone_ingredient, technic_compat.sand_ingredient.." 2"}, -- reverse recipe can be found in the compressor + {technic_compat.desert_stone_ingredient, technic_compat.desert_sand_ingredient.." 2"}, -- reverse recipe can be found in the compressor + {technic_compat.ice_block_ingredient, technic_compat.snow_block_ingredient}, + } + + alloy_recipes = { + {"technic:copper_dust 7", "technic:tin_dust", "technic:bronze_dust 8", 12}, + {technic_compat.copper_ingredient.." 7", technic_compat.tin_ingredient, technic_compat.bronze_ingredient.." 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}, + {"technic:carbon_steel_ingot 2", "technic:coal_dust", "technic:cast_iron_ingot 2", 6}, + {"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"}, + {technic_compat.copper_ingredient.." 2", "technic:zinc_ingot", "basic_materials:brass_ingot 3"}, + {technic_compat.sand_ingredient.." 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}, + {technic_compat.ice_block_ingredient, technic_compat.emtpy_bucket_ingredient, technic_compat.water_bucket_ingredient, 1 }, + } + + for _, data in pairs(alloy_recipes) do + mcl_craftguide.register_craft({ + type = "alloy_furnace", + width = 1, + output = data[3], + items = {data[1], data[2]}, + }) + end + + -- Register Centrifuge Recipes + for _, data in pairs(centrifuge_recipes) do + mcl_craftguide.register_craft({ + type = "centrifuge", + width = 1, + output = table.concat({data[2], data[3], data[4]}, " "), + items = {data[1]}, + }) + end + + -- Register Compressor Recipes + for _, data in pairs(compressor_recipes) do + mcl_craftguide.register_craft({ + type = "compressor", + width = 1, + output = data[2], + items = {data[1]}, + }) + end + + -- Register Extractor Recipes + for _, data in ipairs(extractor_recipes) do + mcl_craftguide.register_craft({ + type = "extractor", + width = 1, + output = data[2], + items = {data[1]}, + }) + end + + -- Register Freezer Recipes + for _, data in pairs(freezer_recipes) do + local output_string + if type(data[2]) == "table" then + output_string = table.concat(data[2], ", ") + else + output_string = data[2] + end + + mcl_craftguide.register_craft({ + type = "freezer", + width = 1, + output = output_string, + items = {data[1]}, + }) + end + + + -- Register Grinder Recipes + for _, data in pairs(grinder_recipes) do + mcl_craftguide.register_craft({ + type = "grinder", + width = 1, + output = data[2], + items = {data[1]}, + }) + end +end \ No newline at end of file diff --git a/technic_compat/mcl/crafting.lua b/technic_compat/mcl/crafting.lua new file mode 100644 index 0000000..6b34d3e --- /dev/null +++ b/technic_compat/mcl/crafting.lua @@ -0,0 +1,102 @@ +-- Helper function to set compatibility variables +local function set_compat(mcl_value, default_value) + return technic_compat.mcl and mcl_value or default_value +end + +-- Mineclone2 Support +technic_compat.copper_ingredient = technic_compat.mcl and "mcl_copper:copper_ingot" or 'default:copper_ingot' +technic_compat.iron_ingredient = technic_compat.mcl and "mcl_core:iron_ingot" or 'default:steel_ingot' +technic_compat.iron_lump_ingredient = technic_compat.mcl and "mcl_raw_ores:raw_iron" or 'default:iron_lump' +technic_compat.gold_lump_ingredient = technic_compat.mcl and "mcl_raw_ores:raw_gold" or 'default:gold_lump' +technic_compat.copper_lump_ingredient = technic_compat.mcl and "mcl_copper:raw_copper" or 'default:copper_lump' +technic_compat.mese_crystal_ingredient = technic_compat.mcl and "mesecons:wire_00000000_off" or 'default:mese_crystal' +technic_compat.diamond_ingredient = technic_compat.mcl and "mcl_core:diamond" or 'default:diamond' +technic_compat.glass_ingredient = technic_compat.mcl and "mcl_core:glass" or 'default:glass' +technic_compat.brick_block_ingredient = technic_compat.mcl and "mcl_core:brick_block" or 'default:brick' +technic_compat.mese_block_ingredient = technic_compat.mcl and "mesecons_torch:redstoneblock" or "default:mese" +technic_compat.paper_ingredient = technic_compat.mcl and "mcl_core:paper" or 'default:paper' +technic_compat.obsidian_glass_ingredient = technic_compat.mcl and "mcl_core:obsidian" or 'default:obsidian_glass' +technic_compat.obsidian_ingredient = technic_compat.mcl and "mcl_core:obsidian" or 'default:obsidian' +technic_compat.green_dye_ingredient = technic_compat.mcl and "mcl_dye:green" or 'dye:green' +technic_compat.blue_dye_ingredient = technic_compat.mcl and "mcl_dye:blue" or 'dye:blue' +technic_compat.red_dye_ingredient = technic_compat.mcl and "mcl_dye:red" or 'dye:red' +technic_compat.white_dye_ingredient = technic_compat.mcl and "mcl_dye:white" or 'dye:white' +technic_compat.gold_ingot_ingredient = technic_compat.mcl and "mcl_core:gold_ingot" or 'default:gold_ingot' +technic_compat.chest_ingredient = technic_compat.mcl and "mcl_chests:chest" or "default:chest" +technic_compat.stone_ingredient = technic_compat.mcl and "mcl_core:stone" or "default:stone" +technic_compat.wood_fence_ingredient = technic_compat.mcl and "group:fence_wood" or "default:fence_wood" +technic_compat.diamond_ingredient = technic_compat.mcl and "mcl_core:diamond" or "default:diamond" +technic_compat.bronze_ingredient = technic_compat.mcl and "mcl_copper:copper_ingot" or 'default:bronze_ingot' +technic_compat.tin_ingredient = technic_compat.mcl and "moreores:tin_ingot" or 'default:tin_ingot' +technic_compat.sandstone_ingredient = technic_compat.mcl and "mcl_core:sandstone" or 'default:desert_stone' +technic_compat.sand_ingredient = technic_compat.mcl and "mcl_core:sand" or 'default:sand' +technic_compat.gravel_ingredient = technic_compat.mcl and "mcl_core:gravel" or 'default:gravel' +technic_compat.desert_stone_ingredient = technic_compat.mcl and "mcl_core:redsandstone" or 'default:desert_stone' +technic_compat.desert_sand_ingredient = technic_compat.mcl and "mcl_core:redsand" or 'default:desert_sand' +technic_compat.furnace_ingredient = technic_compat.mcl and "mcl_furnaces:furnace" or 'default:furnace' +technic_compat.mossy_cobble_ingredient = technic_compat.mcl and "mcl_core:mossycobble" or 'default:mossycobble' +technic_compat.cobble_ingredient = technic_compat.mcl and "mcl_core:cobble" or 'default:cobble' +technic_compat.snow_block_ingredient = technic_compat.mcl and "mcl_core:snowblock" or 'default:snowblock' +technic_compat.ice_block_ingredient = technic_compat.mcl and "mcl_core:ice" or 'default:ice' +technic_compat.granite_ingredient = technic_compat.mcl and "mcl_core:granite" or 'technic:granite' +technic_compat.granite_bricks_ingredient = technic_compat.mcl and "mcl_core:granite_smooth" or 'technic:granite_bricks' +technic_compat.coal_ingredient = technic_compat.mcl and "group:coal" or "default:coal_lump" +technic_compat.dirt_ingredient = technic_compat.mcl and "mcl_core:dirt" or "default:dirt" +technic_compat.mesecons_fiber_ingredient = technic_compat.mcl and "mesecons:wire_00000000_off" or "mesecons_materials:fiber" +technic_compat.stick_ingredient = technic_compat.mcl and "mcl_core:stick" or "default:stick" +technic_compat.emtpy_bucket_ingredient = technic_compat.mcl and "mcl_buckets:bucket_empty" or "bucket:bucket_empty" +technic_compat.water_bucket_ingredient = technic_compat.mcl and "mcl_buckets:bucket_water" or "bucket:bucket_water" + +-- Ingredient Variables +if technic_compat.mcl then + technic_compat.blueberries_ingredient = "mcl_farming:blueberries" + technic_compat.grass_ingredient = "mcl_core:grass" + technic_compat.dry_shrub_ingredient = "mcl_core:deadbush" + technic_compat.junglegrass_ingredient = "mcl_core:tallgrass" + technic_compat.cactus_ingredient = "mcl_core:cactus" + technic_compat.geranium_ingredient = "mcl_flowers:blue_orchid" + technic_compat.dandelion_white_ingredient = "mcl_flowers:oxeye_daisy" + technic_compat.dandelion_yellow_ingredient = "mcl_flowers:dandelion" + technic_compat.tulip_ingredient = "mcl_flowers:orange_tulip" + technic_compat.rose_ingredient = "mcl_flowers:poppy" + technic_compat.viola_ingredient = "mcl_flowers:allium" +else + technic_compat.blueberries_ingredient = "default:blueberries" + technic_compat.grass_ingredient = "default:grass_1" + technic_compat.dry_shrub_ingredient = "default:dry_shrub" + technic_compat.junglegrass_ingredient = "default:junglegrass" + technic_compat.cactus_ingredient = "default:cactus" + technic_compat.geranium_ingredient = "flowers:geranium" + technic_compat.dandelion_white_ingredient = "flowers:dandelion_white" + technic_compat.dandelion_yellow_ingredient = "flowers:dandelion_yellow" + technic_compat.tulip_ingredient = "flowers:tulip" + technic_compat.rose_ingredient = "flowers:rose" + technic_compat.viola_ingredient = "flowers:viola" +end + +-- Dye Output Variables +if technic_compat.mcl then + technic_compat.dye_black = "mcl_dye:black" + technic_compat.dye_violet = "mcl_dye:violet" + technic_compat.dye_green = "mcl_dye:green" + technic_compat.dye_brown = "mcl_dye:brown" + technic_compat.dye_blue = "mcl_dye:blue" + technic_compat.dye_white = "mcl_dye:white" + technic_compat.dye_yellow = "mcl_dye:yellow" + technic_compat.dye_orange = "mcl_dye:orange" + technic_compat.dye_red = "mcl_dye:red" +else + technic_compat.dye_black = "dye:black" + technic_compat.dye_violet = "dye:violet" + technic_compat.dye_green = "dye:green" + technic_compat.dye_brown = "dye:brown" + technic_compat.dye_blue = "dye:blue" + technic_compat.dye_white = "dye:white" + technic_compat.dye_yellow = "dye:yellow" + technic_compat.dye_orange = "dye:orange" + technic_compat.dye_red = "dye:red" +end + +technic_compat.dirt_with_snow_ingredient = technic_compat.mcl and "mcl_core:dirt_with_grass_snow" or "default:dirt_with_snow" +technic_compat.bucket_lava_ingredient = technic_compat.mcl and "mcl_buckets:bucket_lava" or "bucket:bucket_lava" +technic_compat.bucket_river_water_ingredient = technic_compat.mcl and "mcl_buckets:bucket_river_water" or "bucket:bucket_river_water" diff --git a/technic_compat/mcl/miscellaneous.lua b/technic_compat/mcl/miscellaneous.lua new file mode 100644 index 0000000..d794a29 --- /dev/null +++ b/technic_compat/mcl/miscellaneous.lua @@ -0,0 +1 @@ +technic_compat.mt_light_max = technic_compat.mcl and mcl_core.LIGHT_MAX or (default and default.LIGHT_MAX) diff --git a/technic_compat/mcl/sounds.lua b/technic_compat/mcl/sounds.lua new file mode 100644 index 0000000..afa31db --- /dev/null +++ b/technic_compat/mcl/sounds.lua @@ -0,0 +1 @@ +technic_compat.stone_sounds = technic_compat.mcl and mcl_sounds.node_sound_stone_defaults() or default.node_sound_stone_defaults() \ No newline at end of file diff --git a/technic_compat/mcl/textures.lua b/technic_compat/mcl/textures.lua new file mode 100644 index 0000000..87055a4 --- /dev/null +++ b/technic_compat/mcl/textures.lua @@ -0,0 +1,10 @@ +local dirt_texture = technic_compat.mcl and "default_dirt.png" or "default_dirt.png" +local grass_texture = technic_compat.mcl and "mcl_core_palette_grass.png" or "default_grass.png" +local wood_texture = technic_compat.mcl and "default_wood.png" or "default_wood.png" +local stone_texture = technic_compat.mcl and "default_stone.png" or "default_stone.png" +local cobble_texture = technic_compat.mcl and "default_cobble.png" or "default_cobble.png" +local brick_texture = technic_compat.mcl and "default_brick.png" or "default_brick.png" +local sandstone_texture = technic_compat.mcl and "mcl_core_sandstone_top.png" or "default_sandstone.png" +local leaves_texture = technic_compat.mcl and "default_leaves.png" or "default_leaves.png" +local tree_texture = technic_compat.mcl and "default_tree.png" or "default_tree.png" +local bronzeblock_texture = technic_compat.mcl and "mcl_core_bronze_block.png" or "default_bronze_block.png" \ No newline at end of file diff --git a/technic_compat/mod.conf b/technic_compat/mod.conf new file mode 100644 index 0000000..ee252ab --- /dev/null +++ b/technic_compat/mod.conf @@ -0,0 +1,4 @@ +name = technic_compat +description = Makes Technic compatible with other games and mods +optional_depends = mcl_core, mcl_sounds, default, mcl_craftguide +supported_games = minetest_game,mineclone2,mineclonia,mineclone5 \ No newline at end of file diff --git a/technic_worldgen/mod.conf b/technic_worldgen/mod.conf index 94fb64d..833980b 100644 --- a/technic_worldgen/mod.conf +++ b/technic_worldgen/mod.conf @@ -1,4 +1,4 @@ name = technic_worldgen -depends = basic_materials +depends = basic_materials, technic_compat optional_depends = intllib, mg, doors, farming, glooptest, mesecons_doors, vessels, default, mcl_core, mcl_sounds supported_games = minetest_game,mineclone2,mineclonia,mineclone5 From b96d32b5ecac5180ba977ceee9974aa10f31470a Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Thu, 28 Dec 2023 14:02:37 +0000 Subject: [PATCH 22/32] Added back LV Furnace Recipe --- technic/machines/LV/electric_furnace.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/technic/machines/LV/electric_furnace.lua b/technic/machines/LV/electric_furnace.lua index cd5f38e..ad25b85 100644 --- a/technic/machines/LV/electric_furnace.lua +++ b/technic/machines/LV/electric_furnace.lua @@ -3,7 +3,7 @@ -- FIXME: kpoppel I'd like to introduce an induction heating element here also minetest.register_craft({ - output = 'technic:electric_furnace', + output = 'technic:lv_electric_furnace', recipe = { {technic_compat.cobble_ingredient, technic_compat.cobble_ingredient, technic_compat.cobble_ingredient}, {technic_compat.cobble_ingredient, 'technic:machine_casing', technic_compat.cobble_ingredient}, From abbb4ead1b2dbf3ad0dc0267c2e6db49678f72f6 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Thu, 28 Dec 2023 15:20:58 +0000 Subject: [PATCH 23/32] Fixed coal grinding recipe --- technic_compat/mcl/crafting.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/technic_compat/mcl/crafting.lua b/technic_compat/mcl/crafting.lua index 6b34d3e..236cb22 100644 --- a/technic_compat/mcl/crafting.lua +++ b/technic_compat/mcl/crafting.lua @@ -40,7 +40,7 @@ technic_compat.snow_block_ingredient = technic_compat.mcl and "mcl_core:snowbloc technic_compat.ice_block_ingredient = technic_compat.mcl and "mcl_core:ice" or 'default:ice' technic_compat.granite_ingredient = technic_compat.mcl and "mcl_core:granite" or 'technic:granite' technic_compat.granite_bricks_ingredient = technic_compat.mcl and "mcl_core:granite_smooth" or 'technic:granite_bricks' -technic_compat.coal_ingredient = technic_compat.mcl and "group:coal" or "default:coal_lump" +technic_compat.coal_ingredient = technic_compat.mcl and "mcl_core:coal_lump" or "default:coal_lump" technic_compat.dirt_ingredient = technic_compat.mcl and "mcl_core:dirt" or "default:dirt" technic_compat.mesecons_fiber_ingredient = technic_compat.mcl and "mesecons:wire_00000000_off" or "mesecons_materials:fiber" technic_compat.stick_ingredient = technic_compat.mcl and "mcl_core:stick" or "default:stick" From 5b52a94da7a215c934646d41eb03ce3ae60e7d05 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Thu, 28 Dec 2023 15:29:10 +0000 Subject: [PATCH 24/32] Fixed Water Mill Node --- technic/machines/LV/water_mill.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/technic/machines/LV/water_mill.lua b/technic/machines/LV/water_mill.lua index 4250108..9a52a2e 100644 --- a/technic/machines/LV/water_mill.lua +++ b/technic/machines/LV/water_mill.lua @@ -19,8 +19,15 @@ minetest.register_craft({ local function check_node_around_mill(pos) local node = minetest.get_node(pos) - if node.name == "default:water_flowing" - or node.name == "default:river_water_flowing" then + if technic_compat.mcl then + local water_flowing_node = "mcl_core:water_flowing" + local river_water_flowing_node = "mclx_core:river_water_flowing" + else + local water_flowing_node = "default:water_flowing" + local river_water_flowing_node = "default:river_water_flowing" + end + if node.name == water_flowing_node + or node.name == river_water_flowing_node then return node.param2 -- returns approx. water flow, if any end return false From ee0bfa0e26e95d8b4645dcab791334f62dec8a0d Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Thu, 28 Dec 2023 15:37:08 +0000 Subject: [PATCH 25/32] Fix geothermal generator --- technic/machines/LV/geothermal.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/technic/machines/LV/geothermal.lua b/technic/machines/LV/geothermal.lua index e6ae085..457032d 100644 --- a/technic/machines/LV/geothermal.lua +++ b/technic/machines/LV/geothermal.lua @@ -26,8 +26,19 @@ minetest.register_craftitem("technic:geothermal", { local check_node_around = function(pos) local node = minetest.get_node(pos) - if node.name == "default:water_source" or node.name == "default:water_flowing" then return 1 end - if node.name == "default:lava_source" or node.name == "default:lava_flowing" then return 2 end + if technic_compat.mcl then + local water_flowing_node = "mcl_core:water_flowing" + local lava_flowing_node = "mcl_core:lava_flowing" + local water_source_node = "mcl_core:water_source" + local lava_source_node = "mcl_core:lava_source" + else + local water_flowing_node = "default:water_flowing" + local lava_flowing_node = "default:lava_flowing" + local water_source_node = "default:water_source" + local lava_source_node = "default:lava_source" + end + if node.name == water_source_node or node.name == water_flowing_node then return 1 end + if node.name == lava_source_node or node.name == lava_flowing_node then return 2 end return 0 end From 16b270c6e7c7a806a734b6c90c113176448a97fa Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Thu, 28 Dec 2023 15:53:59 +0000 Subject: [PATCH 26/32] Fixed Water mill code --- technic/machines/LV/water_mill.lua | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/technic/machines/LV/water_mill.lua b/technic/machines/LV/water_mill.lua index 9a52a2e..8461562 100644 --- a/technic/machines/LV/water_mill.lua +++ b/technic/machines/LV/water_mill.lua @@ -19,15 +19,7 @@ minetest.register_craft({ local function check_node_around_mill(pos) local node = minetest.get_node(pos) - if technic_compat.mcl then - local water_flowing_node = "mcl_core:water_flowing" - local river_water_flowing_node = "mclx_core:river_water_flowing" - else - local water_flowing_node = "default:water_flowing" - local river_water_flowing_node = "default:river_water_flowing" - end - if node.name == water_flowing_node - or node.name == river_water_flowing_node then + if minetest.get_item_group(node.name, "water") == 3 and string.find(node.name, "flowing") then return node.param2 -- returns approx. water flow, if any end return false From 21d76f0b70990885ee950e52fda51c2055fe7430 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Thu, 28 Dec 2023 15:58:13 +0000 Subject: [PATCH 27/32] Fix Lava geothermal generator --- technic/machines/LV/geothermal.lua | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/technic/machines/LV/geothermal.lua b/technic/machines/LV/geothermal.lua index 457032d..dee913f 100644 --- a/technic/machines/LV/geothermal.lua +++ b/technic/machines/LV/geothermal.lua @@ -26,19 +26,8 @@ minetest.register_craftitem("technic:geothermal", { local check_node_around = function(pos) local node = minetest.get_node(pos) - if technic_compat.mcl then - local water_flowing_node = "mcl_core:water_flowing" - local lava_flowing_node = "mcl_core:lava_flowing" - local water_source_node = "mcl_core:water_source" - local lava_source_node = "mcl_core:lava_source" - else - local water_flowing_node = "default:water_flowing" - local lava_flowing_node = "default:lava_flowing" - local water_source_node = "default:water_source" - local lava_source_node = "default:lava_source" - end - if node.name == water_source_node or node.name == water_flowing_node then return 1 end - if node.name == lava_source_node or node.name == lava_flowing_node then return 2 end + if minetest.get_item_group(node.name, "water") == 3 and (string.find(node.name, "flowing") or string.find(node.name, "source")) then return 1 end + if minetest.get_item_group(node.name, "lava") == 3 and (string.find(node.name, "flowing") or string.find(node.name, "source")) then return 2 end return 0 end From 4f59214f343deba26bd7300dd94832e5b9ec3fd9 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Sat, 30 Dec 2023 13:33:32 +0000 Subject: [PATCH 28/32] Fix cans --- technic/tools/cans.lua | 12 ++++++------ technic_compat/init.lua | 1 + technic_compat/mcl/fluids.lua | 6 ++++++ 3 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 technic_compat/mcl/fluids.lua diff --git a/technic/tools/cans.lua b/technic/tools/cans.lua index caeaebc..3193b51 100644 --- a/technic/tools/cans.lua +++ b/technic/tools/cans.lua @@ -91,8 +91,8 @@ technic.register_can({ can_description = S("Water Can"), can_inventory_image = "technic_water_can.png", can_capacity = 16, - liquid_source_name = "default:water_source", - liquid_flowing_name = "default:water_flowing", + liquid_source_name = technic_compat.water_source_fluid, + liquid_flowing_name = technic_compat.water_flowing_fluid, }) minetest.register_craft({ @@ -109,8 +109,8 @@ technic.register_can({ can_description = S("Lava Can"), can_inventory_image = "technic_lava_can.png", can_capacity = 8, - liquid_source_name = "default:lava_source", - liquid_flowing_name = "default:lava_flowing", + liquid_source_name = technic_compat.lava_source_fluid, + liquid_flowing_name = technic_compat.lava_flowing_fluid, }) minetest.register_craft({ @@ -127,8 +127,8 @@ technic.register_can({ can_description = S("River Water Can"), can_inventory_image = "technic_river_water_can.png", can_capacity = 16, - liquid_source_name = "default:river_water_source", - liquid_flowing_name = "default:river_water_flowing", + liquid_source_name = technic_compat.river_water_source_fluid, + liquid_flowing_name = technic_compat.river_water_flowing_fluid, }) minetest.register_craft({ diff --git a/technic_compat/init.lua b/technic_compat/init.lua index 75122f3..651074c 100644 --- a/technic_compat/init.lua +++ b/technic_compat/init.lua @@ -12,5 +12,6 @@ local mcl_path = modpath .. "/mcl/" dofile(mcl_path .. "sounds.lua") dofile(mcl_path .. "textures.lua") dofile(mcl_path .. "miscellaneous.lua") +dofile(mcl_path .. "fluids.lua") dofile(mcl_path .. "crafting.lua") dofile(mcl_path .. "craftguide.lua") diff --git a/technic_compat/mcl/fluids.lua b/technic_compat/mcl/fluids.lua new file mode 100644 index 0000000..5b54b15 --- /dev/null +++ b/technic_compat/mcl/fluids.lua @@ -0,0 +1,6 @@ +technic_compat.water_source_fluid = technic_compat.mcl and "mcl_core:water_source" or "default:water_source" +technic_compat.water_flowing_fluid = technic_compat.mcl and "mcl_core:water_flowing" or "default:water_flowing" +technic_compat.river_water_source_fluid = technic_compat.mcl and "mclx_core:river_water_source" or "default:river_water_source" +technic_compat.river_water_flowing_fluid = technic_compat.mcl and "mclx_core:river_water_flowing" or "default:river_water_flowing" +technic_compat.lava_source_fluid = technic_compat.mcl and "mcl_core:lava_source" or "default:lava_source" +technic_compat.lava_flowing_fluid = technic_compat.mcl and "mcl_core:lava_flowing" or "default:lava_flowing" \ No newline at end of file From 50191f75fe0d2d9f6c4dc23e6a319450b3c6fd63 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Sun, 31 Dec 2023 16:01:57 +0000 Subject: [PATCH 29/32] Removed fortune enchant effects from non ores --- technic/machines/HV/forcefield.lua | 4 ++-- technic/machines/HV/nuclear_reactor.lua | 4 ++-- technic/machines/HV/quarry.lua | 2 +- technic/machines/LV/geothermal.lua | 4 ++-- technic/machines/LV/lamp.lua | 6 +++--- technic/machines/LV/led.lua | 4 ++-- technic/machines/LV/music_player.lua | 2 +- technic/machines/LV/solar_panel.lua | 2 +- technic/machines/LV/water_mill.lua | 4 ++-- technic/machines/MV/hydro_turbine.lua | 4 ++-- technic/machines/MV/power_radiator.lua | 2 +- technic/machines/MV/tool_workshop.lua | 2 +- technic/machines/MV/wind_mill.lua | 4 ++-- technic/machines/other/anchor.lua | 2 +- technic/machines/other/coal_alloy_furnace.lua | 4 ++-- technic/machines/other/constructor.lua | 4 ++-- technic/machines/other/frames.lua | 2 +- technic/machines/power_monitor.lua | 2 +- technic/machines/supply_converter.lua | 2 +- 19 files changed, 30 insertions(+), 30 deletions(-) diff --git a/technic/machines/HV/forcefield.lua b/technic/machines/HV/forcefield.lua index 1613a49..8e3a37c 100644 --- a/technic/machines/HV/forcefield.lua +++ b/technic/machines/HV/forcefield.lua @@ -317,7 +317,7 @@ minetest.register_node("technic:forcefield_emitter_off", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) minetest.register_node("technic:forcefield_emitter_on", { @@ -353,7 +353,7 @@ minetest.register_node("technic:forcefield_emitter_on", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) minetest.register_node("technic:forcefield", { diff --git a/technic/machines/HV/nuclear_reactor.lua b/technic/machines/HV/nuclear_reactor.lua index 78d15cc..e16b371 100644 --- a/technic/machines/HV/nuclear_reactor.lua +++ b/technic/machines/HV/nuclear_reactor.lua @@ -440,7 +440,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) minetest.register_node("technic:hv_nuclear_reactor_core_active", { @@ -494,7 +494,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core_active", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) technic.register_machine("HV", "technic:hv_nuclear_reactor_core", technic.producer) diff --git a/technic/machines/HV/quarry.lua b/technic/machines/HV/quarry.lua index 153a51e..c57a7c8 100644 --- a/technic/machines/HV/quarry.lua +++ b/technic/machines/HV/quarry.lua @@ -293,7 +293,7 @@ minetest.register_node("technic:quarry", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) technic.register_machine("HV", "technic:quarry", technic.receiver) diff --git a/technic/machines/LV/geothermal.lua b/technic/machines/LV/geothermal.lua index dee913f..f4cf0e9 100644 --- a/technic/machines/LV/geothermal.lua +++ b/technic/machines/LV/geothermal.lua @@ -100,7 +100,7 @@ minetest.register_node("technic:geothermal", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) minetest.register_node("technic:geothermal_active", { @@ -117,7 +117,7 @@ minetest.register_node("technic:geothermal_active", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) technic.register_machine("LV", "technic:geothermal", technic.producer) diff --git a/technic/machines/LV/lamp.lua b/technic/machines/LV/lamp.lua index cefaec7..e6e6269 100644 --- a/technic/machines/LV/lamp.lua +++ b/technic/machines/LV/lamp.lua @@ -30,7 +30,7 @@ minetest.register_node("technic:dummy_light_source", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) @@ -122,7 +122,7 @@ ndef = { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + } for k, v in pairs(common_fields) do @@ -145,7 +145,7 @@ ndef = { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + } for k, v in pairs(common_fields) do diff --git a/technic/machines/LV/led.lua b/technic/machines/LV/led.lua index b532dd2..fc4fa44 100644 --- a/technic/machines/LV/led.lua +++ b/technic/machines/LV/led.lua @@ -58,7 +58,7 @@ ndef = { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + } for k, v in pairs(common_fields) do @@ -80,7 +80,7 @@ ndef = { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + } for k, v in pairs(common_fields) do diff --git a/technic/machines/LV/music_player.lua b/technic/machines/LV/music_player.lua index e2d2761..66168de 100644 --- a/technic/machines/LV/music_player.lua +++ b/technic/machines/LV/music_player.lua @@ -128,7 +128,7 @@ minetest.register_node("technic:music_player", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) technic.register_machine("LV", "technic:music_player", technic.receiver) diff --git a/technic/machines/LV/solar_panel.lua b/technic/machines/LV/solar_panel.lua index f7684bf..083ef54 100644 --- a/technic/machines/LV/solar_panel.lua +++ b/technic/machines/LV/solar_panel.lua @@ -69,7 +69,7 @@ minetest.register_node("technic:solar_panel", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) technic.register_machine("LV", "technic:solar_panel", technic.producer) diff --git a/technic/machines/LV/water_mill.lua b/technic/machines/LV/water_mill.lua index 8461562..66aaab8 100644 --- a/technic/machines/LV/water_mill.lua +++ b/technic/machines/LV/water_mill.lua @@ -89,7 +89,7 @@ minetest.register_node("technic:water_mill", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) minetest.register_node("technic:water_mill_active", { @@ -108,7 +108,7 @@ minetest.register_node("technic:water_mill_active", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) technic.register_machine("LV", "technic:water_mill", technic.producer) diff --git a/technic/machines/MV/hydro_turbine.lua b/technic/machines/MV/hydro_turbine.lua index d006b29..4a879cb 100644 --- a/technic/machines/MV/hydro_turbine.lua +++ b/technic/machines/MV/hydro_turbine.lua @@ -87,7 +87,7 @@ minetest.register_node("technic:hydro_turbine", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) minetest.register_node("technic:hydro_turbine_active", { @@ -106,7 +106,7 @@ minetest.register_node("technic:hydro_turbine_active", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) technic.register_machine("MV", "technic:hydro_turbine", technic.producer) diff --git a/technic/machines/MV/power_radiator.lua b/technic/machines/MV/power_radiator.lua index b9d6a25..87c042a 100644 --- a/technic/machines/MV/power_radiator.lua +++ b/technic/machines/MV/power_radiator.lua @@ -147,7 +147,7 @@ minetest.register_node("technic:power_radiator", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) minetest.register_abm({ diff --git a/technic/machines/MV/tool_workshop.lua b/technic/machines/MV/tool_workshop.lua index afd0822..b8c3a12 100644 --- a/technic/machines/MV/tool_workshop.lua +++ b/technic/machines/MV/tool_workshop.lua @@ -123,7 +123,7 @@ minetest.register_node("technic:tool_workshop", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) technic.register_machine("MV", "technic:tool_workshop", technic.receiver) diff --git a/technic/machines/MV/wind_mill.lua b/technic/machines/MV/wind_mill.lua index 3a82574..7dc7ab2 100644 --- a/technic/machines/MV/wind_mill.lua +++ b/technic/machines/MV/wind_mill.lua @@ -30,7 +30,7 @@ minetest.register_node("technic:wind_mill_frame", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) local function check_wind_mill(pos) @@ -97,7 +97,7 @@ minetest.register_node("technic:wind_mill", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) technic.register_machine("MV", "technic:wind_mill", technic.producer) diff --git a/technic/machines/other/anchor.lua b/technic/machines/other/anchor.lua index 4ed5a96..d3c1437 100644 --- a/technic/machines/other/anchor.lua +++ b/technic/machines/other/anchor.lua @@ -117,5 +117,5 @@ minetest.register_node("technic:admin_anchor", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) diff --git a/technic/machines/other/coal_alloy_furnace.lua b/technic/machines/other/coal_alloy_furnace.lua index 4e2524b..8976446 100644 --- a/technic/machines/other/coal_alloy_furnace.lua +++ b/technic/machines/other/coal_alloy_furnace.lua @@ -53,7 +53,7 @@ minetest.register_node("technic:coal_alloy_furnace", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) minetest.register_node("technic:coal_alloy_furnace_active", { @@ -74,7 +74,7 @@ minetest.register_node("technic:coal_alloy_furnace_active", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) minetest.register_abm({ diff --git a/technic/machines/other/constructor.lua b/technic/machines/other/constructor.lua index 6549838..04f849f 100644 --- a/technic/machines/other/constructor.lua +++ b/technic/machines/other/constructor.lua @@ -183,7 +183,7 @@ local function make_constructor(mark, length) _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) minetest.register_node("technic:constructor_mk"..mark.."_on", { @@ -206,7 +206,7 @@ local function make_constructor(mark, length) _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) end diff --git a/technic/machines/other/frames.lua b/technic/machines/other/frames.lua index 200aa58..74b7e6d 100644 --- a/technic/machines/other/frames.lua +++ b/technic/machines/other/frames.lua @@ -376,7 +376,7 @@ for zp = 0, 1 do _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) end diff --git a/technic/machines/power_monitor.lua b/technic/machines/power_monitor.lua index e207be6..c25b401 100644 --- a/technic/machines/power_monitor.lua +++ b/technic/machines/power_monitor.lua @@ -36,7 +36,7 @@ minetest.register_node("technic:power_monitor",{ _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) minetest.register_abm({ diff --git a/technic/machines/supply_converter.lua b/technic/machines/supply_converter.lua index f42e23d..63f33c3 100644 --- a/technic/machines/supply_converter.lua +++ b/technic/machines/supply_converter.lua @@ -221,7 +221,7 @@ minetest.register_node("technic:supply_converter", { _mcl_hardness = 3, _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore + }) minetest.register_craft({ From af78e5b60ec28d470c36b928b908f034b3cf0ec4 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Sun, 31 Dec 2023 19:54:25 +0000 Subject: [PATCH 30/32] Fixed RE battery ingredient --- technic/machines/register/battery_box.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/technic/machines/register/battery_box.lua b/technic/machines/register/battery_box.lua index 822a88d..6b6d7a0 100644 --- a/technic/machines/register/battery_box.lua +++ b/technic/machines/register/battery_box.lua @@ -18,7 +18,7 @@ minetest.register_craft({ output = "technic:battery", recipe = { {"group:wood", technic_compat.copper_ingredient, "group:wood"}, - {"group:wood", "default:tin_ingot", "group:wood"}, + {"group:wood", technic_compat.tin_ingredient, "group:wood"}, {"group:wood", technic_compat.copper_ingredient, "group:wood"}, } }) From 3b70b56560d74f4e2af9d897686371f656a500b8 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Mon, 1 Jan 2024 14:53:10 +0000 Subject: [PATCH 31/32] Misc fixes --- technic_worldgen/nodes.lua | 239 ++++++++++++++++++++----------------- 1 file changed, 130 insertions(+), 109 deletions(-) diff --git a/technic_worldgen/nodes.lua b/technic_worldgen/nodes.lua index 011f62f..6d85465 100644 --- a/technic_worldgen/nodes.lua +++ b/technic_worldgen/nodes.lua @@ -1,7 +1,7 @@ local S = technic.worldgen.gettext -minetest.register_node( ":technic:mineral_uranium", { +local mineral_uranium_def = { description = S("Uranium Ore"), tiles = { "default_stone.png^technic_mineral_uranium.png" }, is_ground_content = true, @@ -12,9 +12,9 @@ minetest.register_node( ":technic:mineral_uranium", { _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, _mcl_fortune_drop = mcl_core.fortune_drop_ore -}) +} -minetest.register_node( ":technic:mineral_chromium", { +local mineral_chromium_def = { description = S("Chromium Ore"), tiles = { "default_stone.png^technic_mineral_chromium.png" }, is_ground_content = true, @@ -25,9 +25,9 @@ minetest.register_node( ":technic:mineral_chromium", { _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, _mcl_fortune_drop = mcl_core.fortune_drop_ore -}) +} -minetest.register_node( ":technic:mineral_zinc", { +local mineral_zinc_def = { description = S("Zinc Ore"), tiles = { "default_stone.png^technic_mineral_zinc.png" }, is_ground_content = true, @@ -38,9 +38,9 @@ minetest.register_node( ":technic:mineral_zinc", { _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, _mcl_fortune_drop = mcl_core.fortune_drop_ore -}) +} -minetest.register_node( ":technic:mineral_lead", { +local mineral_lead_def = { description = S("Lead Ore"), tiles = { "default_stone.png^technic_mineral_lead.png" }, is_ground_content = true, @@ -51,9 +51,9 @@ minetest.register_node( ":technic:mineral_lead", { _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, _mcl_fortune_drop = mcl_core.fortune_drop_ore -}) +} -minetest.register_node( ":technic:mineral_sulfur", { +local mineral_sulfur_def = { description = S("Sulfur Ore"), tiles = { "default_stone.png^technic_mineral_sulfur.png" }, is_ground_content = true, @@ -64,7 +64,118 @@ minetest.register_node( ":technic:mineral_sulfur", { _mcl_blast_resistance = 3, _mcl_silk_touch_drop = true, _mcl_fortune_drop = mcl_core.fortune_drop_ore -}) +} + +local marble_def = { + description = S("Marble"), + tiles = { "technic_marble.png" }, + is_ground_content = true, + groups = {cracky=3, marble=1,pickaxey=3}, + sounds = sounds.node_sound_stone_defaults(), + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true +} + +local marble_bricks_def = { + description = S("Marble Bricks"), + tiles = { "technic_marble_bricks.png" }, + is_ground_content = false, + groups = {cracky=3,pickaxey=3}, + sounds = sounds.node_sound_stone_defaults(), + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true +} + +local uranium_block_def = { + description = S("Uranium Block"), + tiles = { "technic_uranium_block.png" }, + is_ground_content = true, + groups = {uranium_block=1, cracky=1, level=2, radioactive=2,pickaxey=5}, + sounds = sounds.node_sound_stone_defaults(), + _mcl_hardness = 5, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true +} + +local chromium_block_def = { + description = S("Chromium Block"), + tiles = { "technic_chromium_block.png" }, + is_ground_content = true, + groups = {cracky=1, level=2,pickaxey=4}, + sounds = sounds.node_sound_stone_defaults(), + _mcl_hardness = 4, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true +} + +local zinc_block_def = { + description = S("Zinc Block"), + tiles = { "technic_zinc_block.png" }, + is_ground_content = true, + groups = {cracky=1, level=2,pickaxey=3}, + sounds = sounds.node_sound_stone_defaults(), + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true +} + +local lead_block_def = { + description = S("Lead Block"), + tiles = { "technic_lead_block.png" }, + is_ground_content = true, + groups = {cracky=1, level=2,pickaxey=5}, + sounds = sounds.node_sound_stone_defaults(), + _mcl_hardness = 5, + _mcl_blast_resistance = 5, + _mcl_silk_touch_drop = true +} + +local cast_iron_block_def = { + description = S("Cast Iron Block"), + tiles = { "technic_cast_iron_block.png" }, + is_ground_content = true, + groups = {cracky=1, level=2}, + sounds = sounds.node_sound_stone_defaults(), + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true +} + +local carbon_steel_block_def = { + description = S("Carbon Steel Block"), + tiles = { "technic_carbon_steel_block.png" }, + is_ground_content = true, + groups = {cracky=1, level=2}, + sounds = sounds.node_sound_stone_defaults(), + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true +} + +local stainless_steel_block_def = { + description = S("Stainless Steel Block"), + tiles = { "technic_stainless_steel_block.png" }, + is_ground_content = true, + groups = {cracky=1, level=2}, + sounds = sounds.node_sound_stone_defaults(), + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true +} + + + +minetest.register_node( ":technic:mineral_uranium", mineral_uranium_def) + +minetest.register_node( ":technic:mineral_chromium", mineral_chromium_def) + +minetest.register_node( ":technic:mineral_zinc", mineral_zinc_def) + +minetest.register_node( ":technic:mineral_lead", mineral_lead_def) + +minetest.register_node( ":technic:mineral_sulfur", mineral_sulfur_def) if minetest.get_modpath("default") then minetest.register_node( ":technic:granite", { @@ -85,77 +196,17 @@ if minetest.get_modpath("default") then }) end -minetest.register_node( ":technic:marble", { - description = S("Marble"), - tiles = { "technic_marble.png" }, - is_ground_content = true, - groups = {cracky=3, marble=1,pickaxey=3}, - sounds = sounds.node_sound_stone_defaults(), - _mcl_hardness = 3, - _mcl_blast_resistance = 3, - _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore -}) +minetest.register_node( ":technic:marble", marble_def) -minetest.register_node( ":technic:marble_bricks", { - description = S("Marble Bricks"), - tiles = { "technic_marble_bricks.png" }, - is_ground_content = false, - groups = {cracky=3,pickaxey=3}, - sounds = sounds.node_sound_stone_defaults(), - _mcl_hardness = 3, - _mcl_blast_resistance = 3, - _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore -}) +minetest.register_node( ":technic:marble_bricks", marble_bricks_def) -minetest.register_node(":technic:uranium_block", { - description = S("Uranium Block"), - tiles = { "technic_uranium_block.png" }, - is_ground_content = true, - groups = {uranium_block=1, cracky=1, level=2, radioactive=2,pickaxey=5}, - sounds = sounds.node_sound_stone_defaults(), - _mcl_hardness = 5, - _mcl_blast_resistance = 3, - _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore -}) +minetest.register_node(":technic:uranium_block", uranium_block_def) -minetest.register_node(":technic:chromium_block", { - description = S("Chromium Block"), - tiles = { "technic_chromium_block.png" }, - is_ground_content = true, - groups = {cracky=1, level=2,pickaxey=4}, - sounds = sounds.node_sound_stone_defaults(), - _mcl_hardness = 4, - _mcl_blast_resistance = 3, - _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore -}) +minetest.register_node(":technic:chromium_block", chromium_block_def) -minetest.register_node(":technic:zinc_block", { - description = S("Zinc Block"), - tiles = { "technic_zinc_block.png" }, - is_ground_content = true, - groups = {cracky=1, level=2,pickaxey=3}, - sounds = sounds.node_sound_stone_defaults(), - _mcl_hardness = 3, - _mcl_blast_resistance = 3, - _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore -}) +minetest.register_node(":technic:zinc_block", zinc_block_def) -minetest.register_node(":technic:lead_block", { - description = S("Lead Block"), - tiles = { "technic_lead_block.png" }, - is_ground_content = true, - groups = {cracky=1, level=2,pickaxey=5}, - sounds = sounds.node_sound_stone_defaults(), - _mcl_hardness = 5, - _mcl_blast_resistance = 5, - _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore, -}) +minetest.register_node(":technic:lead_block", lead_block_def) if minetest.get_modpath("default") then minetest.register_alias("technic:wrought_iron_block", "default:steelblock") @@ -166,41 +217,11 @@ if minetest.get_modpath("default") then }) end -minetest.register_node(":technic:cast_iron_block", { - description = S("Cast Iron Block"), - tiles = { "technic_cast_iron_block.png" }, - is_ground_content = true, - groups = {cracky=1, level=2}, - sounds = sounds.node_sound_stone_defaults(), - _mcl_hardness = 3, - _mcl_blast_resistance = 3, - _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore, -}) +minetest.register_node(":technic:cast_iron_block", cast_iron_block_def) -minetest.register_node(":technic:carbon_steel_block", { - description = S("Carbon Steel Block"), - tiles = { "technic_carbon_steel_block.png" }, - is_ground_content = true, - groups = {cracky=1, level=2}, - sounds = sounds.node_sound_stone_defaults(), - _mcl_hardness = 3, - _mcl_blast_resistance = 3, - _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore, -}) +minetest.register_node(":technic:carbon_steel_block", carbon_steel_block_def) -minetest.register_node(":technic:stainless_steel_block", { - description = S("Stainless Steel Block"), - tiles = { "technic_stainless_steel_block.png" }, - is_ground_content = true, - groups = {cracky=1, level=2}, - sounds = sounds.node_sound_stone_defaults(), - _mcl_hardness = 3, - _mcl_blast_resistance = 3, - _mcl_silk_touch_drop = true, - _mcl_fortune_drop = mcl_core.fortune_drop_ore, -}) +minetest.register_node(":technic:stainless_steel_block", stainless_steel_block_def) if minetest.get_modpath("default") then minetest.register_craft({ From da4f4f5e237d14da9015f1b91027ee2f8c69b7e0 Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Tue, 2 Jan 2024 11:48:35 +0000 Subject: [PATCH 32/32] Fix crash issue --- technic/machines/register/recipes.lua | 35 +++++++++++++++------------ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/technic/machines/register/recipes.lua b/technic/machines/register/recipes.lua index ba4a5e1..660eaec 100644 --- a/technic/machines/register/recipes.lua +++ b/technic/machines/register/recipes.lua @@ -121,22 +121,25 @@ function technic.get_recipe(typename, items) return end local recipe = technic.recipes[typename].recipes[index] - if recipe then - local new_input = {} - for i, stack in ipairs(items) do - if stack:get_count() < recipe.input[stack:get_name()] then - return nil - else - new_input[i] = ItemStack(stack) - new_input[i]:take_item(recipe.input[stack:get_name()]) - end - end - return {time = recipe.time, - new_input = new_input, - output = recipe.output} - else - return nil - end + if recipe then + local new_input = {} + for i, stack in ipairs(items) do + local input_count = recipe.input[stack:get_name()] + if input_count == nil then + -- Handle nil value, maybe return nil or log a warning + return nil + end + if stack:get_count() < input_count then + return nil + else + new_input[i] = ItemStack(stack) + new_input[i]:take_item(input_count) + end + end + return {time = recipe.time, new_input = new_input, output = recipe.output} + else + return nil + end end