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 82b4098..37c7483 100644 --- a/concrete/init.lua +++ b/concrete/init.lua @@ -1,11 +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 = {} --- Boilerplate to support localized strings if intllib mod is installed. -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 + +if minetest.get_modpath("mcl_core") then + stone_ingredient = "mcl_core:stone" +else + stone_ingredient = "default:stone" +end + +if minetest.get_modpath("mcl_sounds") then + stone_sounds = mcl_sounds.node_sound_stone_defaults() +else + stone_sounds = default.node_sound_stone_defaults() +end + + for i = 0, 31 do minetest.register_alias("technic:concrete_post"..i, @@ -26,9 +47,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_ingredient,'basic_materials:steel_bar',stone_ingredient}, + {stone_ingredient,'basic_materials:steel_bar',stone_ingredient}, + {stone_ingredient,'basic_materials:steel_bar',stone_ingredient}, } }) @@ -45,7 +66,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 +101,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 +133,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..cd02408 100644 --- a/concrete/mod.conf +++ b/concrete/mod.conf @@ -1,3 +1,4 @@ name = concrete -depends = default -optional_depends = basic_materials, intllib, moreblocks +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/init.lua b/extranodes/init.lua index 165ba0d..5dd0121 100644 --- a/extranodes/init.lua +++ b/extranodes/init.lua @@ -1,8 +1,29 @@ -- 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 + +-- 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_sounds") then + stone_sounds = mcl_sounds.node_sound_stone_defaults() +else + stone_sounds = default.node_sound_stone_defaults() +end + +wood_fence_ingredient = nil +if minetest.get_modpath("mcl_core") then + wood_fence_ingredient = "group:fence_wood" +else + wood_fence_ingredient = "default:fence_wood" +end + if minetest.get_modpath("moreblocks") then -- register stairsplus/circular_saw nodes @@ -20,7 +41,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 +53,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 +129,9 @@ if minetest.get_modpath("moreblocks") then register_technic_stairs_alias("stairsplus", "concrete", "technic", "concrete") register_technic_stairs_alias("stairsplus", "marble", "technic", "marble") - register_technic_stairs_alias("stairsplus", "granite", "technic", "granite") + 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 +143,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 +177,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 +205,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 +237,33 @@ end minetest.register_node(":technic:insulator_clip", iclip_def) minetest.register_node(":technic:insulator_clip_fencepost", iclipfence_def) +-- MineClone2 support + +if minetest.get_modpath("mcl_core") then + stone_ingredient = "mcl_core:stone" + white_dye_ingredient = "mcl_dye:white" + fence_ingredient = "group:fence" +else + stone_ingredient = "default:stone" + white_dye_ingredient = "dye:white" + fence_ingredient = "default:fence_wood" +end + minetest.register_craft({ output = "technic:insulator_clip", recipe = { - { "", "dye:white", ""}, + { "", white_dye_ingredient, ""}, { "", "technic:raw_latex", ""}, - { "technic:raw_latex", "default:stone", "technic:raw_latex"}, + { "technic:raw_latex", stone_ingredient, "technic:raw_latex"}, } }) minetest.register_craft({ output = "technic:insulator_clip_fencepost 2", recipe = { - { "", "dye:white", ""}, + { "", white_dye_ingredient, ""}, { "", "technic:raw_latex", ""}, - { "technic:raw_latex", "default:fence_wood", "technic:raw_latex"}, + { "technic:raw_latex", wood_fence_ingredient, "technic:raw_latex"}, } }) diff --git a/extranodes/mod.conf b/extranodes/mod.conf index 6f02b1c..e7b5e5e 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, 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 978bae8..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 = { - {'default:mese_crystal', 'technic:copper_coil', 'default:mese_crystal'}, + {technic_compat.mese_crystal_ingredient, 'technic:copper_coil', technic_compat.mese_crystal_ingredient}, {'pipeworks:tube_1', 'technic:control_logic_unit', 'pipeworks:tube_1'}, - {'default:mese_crystal', 'technic:copper_coil', 'default:mese_crystal'}, + {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', 'default:diamond', 'technic:stainless_steel_ingot'}, - {'default:diamond', '', 'default:diamond'}, - {'technic:stainless_steel_ingot', 'default:diamond', '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 = { - {'default:gold_ingot', 'technic:battery', 'dye:green'}, + {technic_compat.gold_ingot_ingredient, 'technic:battery', technic_compat.green_dye_ingredient}, {'technic:battery', 'technic:red_energy_crystal', 'technic:battery'}, - {'dye:green', 'technic:battery', 'default:gold_ingot'}, + {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', 'dye:blue'}, + {'moreores:mithril_ingot', 'technic:battery', technic_compat.blue_dye_ingredient}, {'technic:battery', 'technic:green_energy_crystal', 'technic:battery'}, - {'dye:blue', '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', 'dye:red'}, + {'moreores:silver_ingot', 'technic:battery', technic_compat.red_dye_ingredient}, {'technic:battery', 'basic_materials:energy_crystal_simple', 'technic:battery'}, - {'dye:red', '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', ''}, - {'default:copper_ingot', 'technic:silicon_wafer', 'default:copper_ingot'}, + {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'}, - {'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'}, - {'default:tin_ingot', 'default:tin_ingot', 'default:tin_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}, } }) @@ -175,7 +175,7 @@ minetest.register_craft({ }) minetest.register_craft({ - output = "default:dirt 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", - "default:coal_lump", - "default:coal_lump", - "default:coal_lump", - "default:coal_lump", - "default:coal_lump", - "default:coal_lump", - "default:coal_lump", - "default:coal_lump", + 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, }, }) @@ -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 diff --git a/technic/init.lua b/technic/init.lua index 7669faf..e25dd82 100644 --- a/technic/init.lua +++ b/technic/init.lua @@ -1,11 +1,17 @@ -- namespace: technic -- (c) 2012-2013 by RealBadAngel + + + + 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 {} @@ -34,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/items.lua b/technic/items.lua index d1565d7..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 = default.node_sound_stone_defaults(), + 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 = default.node_sound_stone_defaults(), + 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 5b8ff4f..8e3a37c 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" }, + {technic_compat.mese_block_ingredient, "basic_materials:motor", technic_compat.mese_block_ingredient}, {"technic:deployer_off", "technic:machine_casing", "technic:deployer_off"}, - {"default:mese", "technic:hv_cable", "default:mese" }, + {technic_compat.mese_block_ingredient, "technic:hv_cable", technic_compat.mese_block_ingredient}, } }) @@ -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, + }) 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, + }) minetest.register_node("technic:forcefield", { @@ -354,7 +362,7 @@ minetest.register_node("technic:forcefield", { drawtype = "glasslike", groups = {not_in_creative_inventory=1}, paramtype = "light", - light_source = default.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 431b2ee..fa7e7da 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', 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'}, } @@ -424,9 +424,9 @@ 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 = default.node_sound_wood_defaults(), + sounds = technic_compat.wood_sounds, paramtype = "light", paramtype2 = "facedir", stack_max = 1, @@ -449,6 +449,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, + }) minetest.register_node("technic:hv_nuclear_reactor_core_active", { @@ -459,9 +463,9 @@ 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 = default.node_sound_wood_defaults(), + sounds = technic_compat.wood_sounds, drop = "technic:hv_nuclear_reactor_core", light_source = 14, paramtype = "light", @@ -499,6 +503,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, + }) 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 98a0537..c57a7c8 100644 --- a/technic/machines/HV/quarry.lua +++ b/technic/machines/HV/quarry.lua @@ -229,6 +229,12 @@ local function send_move_error(player) return 0 end +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,11 +242,11 @@ 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", - 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}, @@ -283,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, + }) technic.register_machine("HV", "technic:quarry", technic.receiver) diff --git a/technic/machines/LV/alloy_furnace.lua b/technic/machines/LV/alloy_furnace.lua index 5e4f7c4..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 = { - {'default:brick', 'default:brick', 'default:brick'}, - {'default:brick', 'technic:machine_casing', 'default:brick'}, - {'default:brick', 'technic:lv_cable', 'default:brick'}, + {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 69c0a24..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 = { - {'default:paper', 'default:paper', 'default:paper'}, - {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'}, - {'default:paper', 'default:paper', 'default:paper'}, + {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 84eb4c5..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 = { - {'default:stone', 'basic_materials:motor', 'default:stone'}, + {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 768f04a..ad25b85 100644 --- a/technic/machines/LV/electric_furnace.lua +++ b/technic/machines/LV/electric_furnace.lua @@ -3,11 +3,11 @@ -- 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 = { - {'default:cobble', 'default:cobble', 'default:cobble'}, - {'default:cobble', 'technic:machine_casing', 'default:cobble'}, - {'default:cobble', 'technic:lv_cable', 'default:cobble'}, + {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 dc9815f..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 = { - {'default:stone', 'default:furnace', 'default:stone'}, - {'default:stone', 'technic:machine_casing', 'default:stone'}, - {'default:stone', 'technic:lv_cable', 'default:stone'}, + {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 abe6951..f4cf0e9 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'}, + {technic_compat.granite_ingredient, technic_compat.diamond_ingredient, technic_compat.granite_ingredient}, {'basic_materials:copper_wire', 'technic:machine_casing', 'basic_materials:copper_wire'}, - {'technic:granite', 'technic:lv_cable', 'technic:granite'}, + {technic_compat.granite_ingredient, 'technic:lv_cable', technic_compat.granite_ingredient}, }, replacements = { {"basic_materials:copper_wire", "basic_materials:empty_spool"}, @@ -26,8 +26,8 @@ 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 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 @@ -87,16 +87,20 @@ 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 = default.node_sound_wood_defaults(), + 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")) meta:set_int("LV_EU_supply", 0) end, technic_run = run, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + }) 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 = default.node_sound_wood_defaults(), + sounds = technic_compat.wood_sounds, drop = "technic:geothermal", technic_run = run, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + }) technic.register_machine("LV", "technic:geothermal", technic.producer) diff --git a/technic/machines/LV/grinder.lua b/technic/machines/LV/grinder.lua index 9e45bf4..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 = { - {'default:desert_stone', 'default:diamond', 'default:desert_stone'}, - {'default:desert_stone', 'technic:machine_casing', 'default:desert_stone'}, - {'technic:granite', 'technic:lv_cable', 'technic:granite'}, + {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 a4605f2..e6e6269 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, + }) @@ -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, + } 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, + } for k, v in pairs(common_fields) do @@ -149,7 +161,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"}, + {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/led.lua b/technic/machines/LV/led.lua index 3786ab7..fc4fa44 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, + } 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, + } 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 3bbb441..66168de 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', 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}, } }) @@ -94,9 +94,9 @@ 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 = default.node_sound_wood_defaults(), + 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")) @@ -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, + }) 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 b3daedc..083ef54 100644 --- a/technic/machines/LV/solar_panel.lua +++ b/technic/machines/LV/solar_panel.lua @@ -48,9 +48,9 @@ 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 = default.node_sound_wood_defaults(), + sounds = technic_compat.wood_sounds, description = S("Small Solar %s Generator"):format("LV"), active = false, drawtype = "nodebox", @@ -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, + }) 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 e26224e..66aaab8 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', technic_compat.diamond_ingredient, 'technic:marble'}, {'group:wood', 'technic:machine_casing', 'group:wood'}, {'technic:marble', 'technic:lv_cable', 'technic:marble'}, } @@ -19,8 +19,7 @@ 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 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 @@ -78,15 +77,19 @@ 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 = default.node_sound_wood_defaults(), + 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")) meta:set_int("LV_EU_supply", 0) end, technic_run = run, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + }) minetest.register_node("technic:water_mill_active", { @@ -96,12 +99,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 = default.node_sound_wood_defaults(), + 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, + }) 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 0d4904c..4a879cb 100644 --- a/technic/machines/MV/hydro_turbine.lua +++ b/technic/machines/MV/hydro_turbine.lua @@ -75,15 +75,19 @@ 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 = default.node_sound_wood_defaults(), + 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")) meta:set_int("MV_EU_supply", 0) end, technic_run = run, + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + }) 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 = default.node_sound_wood_defaults(), + 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, + }) technic.register_machine("MV", "technic:hydro_turbine", technic.producer) diff --git a/technic/machines/MV/lighting.lua b/technic/machines/MV/lighting.lua index f7c9124..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 = default.node_sound_wood_defaults(), + 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 = default.node_sound_wood_defaults(), + 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 = default.node_sound_wood_defaults(), + 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 = default.node_sound_wood_defaults(), + 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 = default.node_sound_wood_defaults(), + 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 = default.node_sound_wood_defaults(), + 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 = default.node_sound_wood_defaults(), + 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 = default.node_sound_wood_defaults(), + 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 = default.node_sound_wood_defaults(), + 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 = default.node_sound_wood_defaults(), + 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 = default.node_sound_wood_defaults(), + 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 = default.node_sound_wood_defaults(), + 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 329f055..87c042a 100644 --- a/technic/machines/MV/power_radiator.lua +++ b/technic/machines/MV/power_radiator.lua @@ -122,8 +122,8 @@ 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}, - sounds = default.node_sound_wood_defaults(), + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, pickaxey=3}, + sounds = technic_compat.wood_sounds, drawtype = "nodebox", paramtype = "light", is_ground_content = true, @@ -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, + }) minetest.register_abm({ diff --git a/technic/machines/MV/tool_workshop.lua b/technic/machines/MV/tool_workshop.lua index 678a1fd..b8c3a12 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', technic_compat.diamond_ingredient, 'group:wood'}, {'mesecons_pistons:piston_sticky_off', 'technic:machine_casing', 'technic:carbon_cloth'}, - {'default:obsidian', 'technic:mv_cable', 'default:obsidian'}, + {technic_compat.obsidian_ingredient, 'technic:mv_cable', technic_compat.obsidian_ingredient}, } }) @@ -93,9 +93,9 @@ 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 = default.node_sound_wood_defaults(), + 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")) @@ -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, + }) 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 1baf54c..7dc7ab2 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}, - sounds = default.node_sound_stone_defaults(), + groups = {cracky=3, pickaxey=3}, + sounds = technic_compat.stone_sounds, paramtype = "light", + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + }) local function check_wind_mill(pos) @@ -70,9 +74,9 @@ 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 = default.node_sound_stone_defaults(), + sounds = technic_compat.stone_sounds, drawtype = "nodebox", paramtype = "light", node_box = { @@ -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, + }) technic.register_machine("MV", "technic:wind_mill", technic.producer) diff --git a/technic/machines/other/anchor.lua b/technic/machines/other/anchor.lua index 44aeffa..d3c1437 100644 --- a/technic/machines/other/anchor.lua +++ b/technic/machines/other/anchor.lua @@ -72,8 +72,8 @@ 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}, - sounds = default.node_sound_stone_defaults(), + 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) if placer and placer:is_player() then @@ -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, + }) diff --git a/technic/machines/other/coal_alloy_furnace.lua b/technic/machines/other/coal_alloy_furnace.lua index c2de151..8976446 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'}, + {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}, } }) @@ -34,9 +34,9 @@ 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 = default.node_sound_stone_defaults(), + sounds = technic_compat.stone_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("formspec", formspec) @@ -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, + }) 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 = default.node_sound_stone_defaults(), + 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, + }) minetest.register_abm({ 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..04f849f 100644 --- a/technic/machines/other/constructor.lua +++ b/technic/machines/other/constructor.lua @@ -140,9 +140,9 @@ 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 = default.node_sound_stone_defaults(), + sounds = technic_compat.stone_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) local formspec = "size[8,9;]".. @@ -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, + }) 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 = default.node_sound_stone_defaults(), + 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, + }) end diff --git a/technic/machines/other/frames.lua b/technic/machines/other/frames.lua index c116187..74b7e6d 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, + }) 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 @@ -981,7 +1000,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', technic_compat.mese_crystal_ingredient, 'basic_materials:brass_ingot' }, { '', 'basic_materials:brass_ingot', '' }, } }) @@ -1009,7 +1028,7 @@ minetest.register_craft({ output = 'technic:template_tool', recipe = { { '', 'technic:template', '' }, - { 'default:mese_crystal', 'default:stick', 'default:mese_crystal' }, + { 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 6bd5a83..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',''}, - {'', 'default:chest',''}, + {'', technic_compat.chest_ingredient,''}, {'', 'pipeworks:tube_1',''}, } }) @@ -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) @@ -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 = technic_compat.wood_sounds, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Self-Contained Injector")) @@ -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 7e8b850..c25b401 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", technic_compat.copper_ingredient}, {"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"} } }) @@ -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 = default.node_sound_wood_defaults(), + 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, + }) minetest.register_abm({ diff --git a/technic/machines/register/alloy_recipes.lua b/technic/machines/register/alloy_recipes.lua index 388e0bb..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}, - {"default:copper_ingot 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}, - {"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"}, - {"default:copper_ingot 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 - -- 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 }, -} - -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/machines/register/battery_box.lua b/technic/machines/register/battery_box.lua index f0e67f3..8c55505 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", "default:tin_ingot", "group:wood"}, - {"group:wood", "default:copper_ingot", "group:wood"}, + {"group:wood", technic_compat.copper_ingredient, "group:wood"}, + {"group:wood", technic_compat.tin_ingredient, "group:wood"}, + {"group:wood", technic_compat.copper_ingredient, "group:wood"}, } }) -- Sulfur-lead-water recipes: @@ -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 @@ -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 = technic_compat.wood_sounds, drop = "technic:"..ltier.."_battery_box0", on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -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 70da6d6..51af47d 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 = { @@ -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 = technic_compat.wood_sounds, drop = "technic:"..ltier.."_cable", paramtype = "light", sunlight_propagates = true, @@ -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 = { @@ -201,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 = default.node_sound_wood_defaults(), + sounds = technic_compat.wood_sounds, drop = "technic:"..ltier.."_cable_plate_1", paramtype = "light", sunlight_propagates = true, @@ -211,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/centrifuge_recipes.lua b/technic/machines/register/centrifuge_recipes.lua index 11c6788..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", "default:sand", "technic:uranium3_dust" }, - { "default:dirt 4", "default:sand", "default:gravel", "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/common.lua b/technic/machines/register/common.lua index 0e7658b..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 == "default:chest" 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() == "default:chest" 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/compressor_recipes.lua b/technic/machines/register/compressor_recipes.lua index acb9eca..3436983 100644 --- a/technic/machines/register/compressor_recipes.lua +++ b/technic/machines/register/compressor_recipes.lua @@ -8,19 +8,9 @@ function technic.register_compressor_recipe(data) technic.register_recipe("compressing", 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"}, - {"technic:mixed_metal_ingot", "technic:composite_plate"}, - {"default:copper_ingot 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(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({ recipe = { @@ -41,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 ba43df5..090260b 100644 --- a/technic/machines/register/extractor_recipes.lua +++ b/technic/machines/register/extractor_recipes.lua @@ -8,29 +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"}, - {"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"}, - } - - 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 641b28a..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 = { - {"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" } } -} - -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/generator.lua b/technic/machines/register/generator.lua index 9120e29..846a1a5 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 = @@ -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 = technic_compat.wood_sounds, tube = data.tube and tube or nil, on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -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", { @@ -192,7 +195,7 @@ function technic.register_generator(data) groups = active_groups, connect_sides = {"bottom"}, legacy_facedir_simple = true, - sounds = default.node_sound_wood_defaults(), + sounds = technic_compat.wood_sounds, tube = data.tube and tube or nil, drop = "technic:"..ltier.."_generator", can_dig = technic.machine_can_dig, @@ -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/grinder_recipes.lua b/technic/machines/register/grinder_recipes.lua index 5adb4f0..22ead6f 100644 --- a/technic/machines/register/grinder_recipes.lua +++ b/technic/machines/register/grinder_recipes.lua @@ -8,33 +8,11 @@ function technic.register_grinder_recipe(data) technic.register_recipe("grinding", 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"}, - -- 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"}, -} +if minetest.get_modpath("default") then + 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) minetest.clear_craft({ @@ -54,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 @@ -104,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", "default:copper_ingot") +register_dust("Copper", technic_compat.copper_ingredient) register_dust("Lead", "technic:lead_ingot") -register_dust("Gold", "default:gold_ingot") +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", "default:tin_ingot") +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 8e1dee7..c69ab6c 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 = @@ -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 = technic_compat.wood_sounds, on_construct = function(pos) local node = minetest.get_node(pos) local meta = minetest.get_meta(pos) @@ -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",{ @@ -245,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 = default.node_sound_wood_defaults(), + 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, @@ -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/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 diff --git a/technic/machines/register/solar_array.lua b/technic/machines/register/solar_array.lua index 443ac90..1469467 100644 --- a/technic/machines/register/solar_array.lua +++ b/technic/machines/register/solar_array.lua @@ -43,9 +43,9 @@ 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 = default.node_sound_wood_defaults(), + sounds = technic_compat.wood_sounds, description = S("Arrayed Solar %s Generator"):format(tier), active = false, drawtype = "nodebox", @@ -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 2ecd610..63f33c3 100644 --- a/technic/machines/supply_converter.lua +++ b/technic/machines/supply_converter.lua @@ -198,9 +198,9 @@ 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 = default.node_sound_wood_defaults(), + sounds = technic_compat.wood_sounds, on_receive_fields = supply_converter_receive_fields, on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -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, + }) minetest.register_craft({ diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua index 521e2f8..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", ""}, - {"default:copper_ingot", "technic:machine_casing", "default:copper_ingot"}, + {technic_compat.copper_ingredient, "technic:machine_casing", technic_compat.copper_ingredient}, {"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"} } }) @@ -36,9 +36,9 @@ 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 = default.node_sound_wood_defaults(), + 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/mod.conf b/technic/mod.conf index 7b8d08c..70c92cb 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, 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 7092b69..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, - ["default:mese"] = 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, - ["default:obsidian_glass"] = 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:granite"] = 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 = default.node_sound_stone_defaults(), + sounds = technic_compat.stone_sounds, light_source = 2, }) diff --git a/technic/tools/cans.lua b/technic/tools/cans.lua index 52d5eab..a018bd6 100644 --- a/technic/tools/cans.lua +++ b/technic/tools/cans.lua @@ -86,8 +86,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({ @@ -104,8 +104,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({ @@ -122,15 +122,15 @@ 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({ 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'}, + {technic_compat.iron_ingredient, '', technic_compat.iron_ingredient}, + {'technic:zinc_ingot', technic_compat.iron_ingredient, 'technic:zinc_ingot'}, } }) diff --git a/technic/tools/chainsaw.lua b/technic/tools/chainsaw.lua index ee8fed7..7c1518d 100644 --- a/technic/tools/chainsaw.lua +++ b/technic/tools/chainsaw.lua @@ -338,7 +338,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/flashlight.lua b/technic/tools/flashlight.lua index 91346d2..18a69ad 100644 --- a/technic/tools/flashlight.lua +++ b/technic/tools/flashlight.lua @@ -114,11 +114,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/tools/mining_drill.lua b/technic/tools/mining_drill.lua index 0fe7135..4860c98 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'}, + {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', 'default:copper_ingot'}, + {'', '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 47fcc17..44d995c 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"}, - {"", "basic_materials:brass_ingot", "technic:red_energy_crystal"}, - {"", "", "default:copper_ingot"}, + {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}, } }) minetest.register_craft({ output = "technic:laser_mk2", recipe = { - {"default:diamond", "technic:carbon_steel_ingot", "technic:laser_mk1"}, - {"", "technic:carbon_steel_ingot", "technic:green_energy_crystal"}, - {"", "", "default:copper_ingot"}, + {technic_compat.diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk1"}, + {"", "technic:carbon_steel_ingot", "technic:green_energy_crystal"}, + {"", "", technic_compat.copper_ingredient}, } }) minetest.register_craft({ output = "technic:laser_mk3", recipe = { - {"default:diamond", "technic:carbon_steel_ingot", "technic:laser_mk2"}, - {"", "technic:carbon_steel_ingot", "technic:blue_energy_crystal"}, - {"", "", "default:copper_ingot"}, + {technic_compat.diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk2"}, + {"", "technic:carbon_steel_ingot", "technic:blue_energy_crystal"}, + {"", "", technic_compat.copper_ingredient}, } }) diff --git a/technic/tools/sonic_screwdriver.lua b/technic/tools/sonic_screwdriver.lua index ceb52a1..d3535ef 100644 --- a/technic/tools/sonic_screwdriver.lua +++ b/technic/tools/sonic_screwdriver.lua @@ -91,9 +91,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"} + {"", 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 ae68b56..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", "default:stick"}, - {"", "default:stick", "default:stick"} + {"pipeworks:tube_1", "group:wood", technic_compat.stick_ingredient}, + {"", technic_compat.stick_ingredient, technic_compat.stick_ingredient} }, }) diff --git a/technic_chests/copper_chest.lua b/technic_chests/copper_chest.lua index c989bac..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 = { - {'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_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 = { - {'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_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 24cbb5c..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 = { - {'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_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 = { - {'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_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 188e516..0f88909 100644 --- a/technic_chests/init.lua +++ b/technic_chests/init.lua @@ -4,6 +4,76 @@ 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 + 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_ingredient = nil +if minetest.get_modpath("mcl_core") then + chest_ingredient = "mcl_chests:chest" +else + chest_ingredient = "default:chest" +end + +copper_ingredient = nil +if minetest.get_modpath("mcl_core") then + copper_ingredient = "mcl_copper:copper_ingot" +else + copper_ingredient = 'default:copper_ingot' +end + +gold_ingot_ingredient = nil +if minetest.get_modpath("mcl_core") then + gold_ingot_ingredient = "mcl_core:gold_ingot" +else + gold_ingot_ingredient = 'default:gold_ingot' +end + +granite_ingredient = nil +if minetest.get_modpath("mcl_core") then + granite_ingredient = "mcl_core:granite" +else + granite_ingredient = 'technic:granite' +end + +granite_bricks_ingredient = nil +if minetest.get_modpath("mcl_core") then + granite_bricks_ingredient = "mcl_core:granite_smooth" +else + granite_bricks_ingredient = 'technic:granite_bricks' +end + +coal_ingredient = nil +if minetest.get_modpath("mcl_core") then + coal_ingredient = "group:coal" +else + coal_ingredient = "default:coal_lump" +end + technic = rawget(_G, "technic") or {} technic.chests = {} diff --git a/technic_chests/iron_chest.lua b/technic_chests/iron_chest.lua index a1945bc..e44eafe 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_ingredient,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..95a5877 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, 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_chests/register.lua b/technic_chests/register.lua index 2cde3b0..0826816 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, @@ -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 2f28264..d10244b 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 = { - {'default:glass', 'technic:diamond_drill_head', 'default:glass'}, - {'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 = { - {'default:glass', 'default:diamond', 'default:glass'}, - {'basic_materials:ic', 'default:steelblock', 'basic_materials:motor'}, - {'default:steel_ingot', 'default:mese', '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'}, }, }) @@ -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_cnc/cnc_materials.lua b/technic_cnc/cnc_materials.lua index e63c792..0e20e30 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 "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 "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" + -- 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/init.lua b/technic_cnc/init.lua index f1cb03b..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 @@ -23,6 +31,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 4e0f940..770d2ae 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, 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..651074c --- /dev/null +++ b/technic_compat/init.lua @@ -0,0 +1,17 @@ +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 .. "fluids.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..236cb22 --- /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 "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" +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/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 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/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..c4b81b3 100644 --- a/technic_worldgen/init.lua +++ b/technic_worldgen/init.lua @@ -1,10 +1,19 @@ local modpath = minetest.get_modpath("technic_worldgen") + +-- Mineclone Support +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 49988f5..833980b 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, technic_compat +optional_depends = intllib, mg, doors, farming, glooptest, mesecons_doors, vessels, default, mcl_core, mcl_sounds +supported_games = minetest_game,mineclone2,mineclonia,mineclone5 diff --git a/technic_worldgen/nodes.lua b/technic_worldgen/nodes.lua index 90888e4..6d85465 100644 --- a/technic_worldgen/nodes.lua +++ b/technic_worldgen/nodes.lua @@ -1,153 +1,237 @@ 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, - groups = {cracky=3, radioactive=1}, - sounds = default.node_sound_stone_defaults(), + groups = {cracky=3, radioactive=1,pickaxey=5,material_stone=1}, + sounds = sounds.node_sound_stone_defaults(), 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", { +local mineral_chromium_def = { description = S("Chromium Ore"), tiles = { "default_stone.png^technic_mineral_chromium.png" }, is_ground_content = true, - groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), + groups = {cracky=3,pickaxey=3,material_stone=1}, + sounds = sounds.node_sound_stone_defaults(), 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", { +local mineral_zinc_def = { description = S("Zinc Ore"), tiles = { "default_stone.png^technic_mineral_zinc.png" }, is_ground_content = true, - groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), + groups = {cracky=3,pickaxey=2,material_stone=1}, + sounds = sounds.node_sound_stone_defaults(), 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", { +local mineral_lead_def = { description = S("Lead Ore"), tiles = { "default_stone.png^technic_mineral_lead.png" }, is_ground_content = true, - groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), + groups = {cracky=3,pickaxey=2,material_stone=1}, + sounds = sounds.node_sound_stone_defaults(), 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", { +local mineral_sulfur_def = { description = S("Sulfur Ore"), tiles = { "default_stone.png^technic_mineral_sulfur.png" }, is_ground_content = true, - groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), + groups = {cracky=3,pickaxey=1,material_stone=1}, + sounds = sounds.node_sound_stone_defaults(), drop = "technic:sulfur_lump", -}) + _mcl_hardness = 1, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = mcl_core.fortune_drop_ore +} -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(), -}) - -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(), -}) - -minetest.register_node( ":technic:marble", { +local marble_def = { description = S("Marble"), tiles = { "technic_marble.png" }, is_ground_content = true, - groups = {cracky=3, marble=1}, - sounds = default.node_sound_stone_defaults(), -}) + 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 +} -minetest.register_node( ":technic:marble_bricks", { +local marble_bricks_def = { description = S("Marble Bricks"), tiles = { "technic_marble_bricks.png" }, is_ground_content = false, - groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), -}) + groups = {cracky=3,pickaxey=3}, + sounds = sounds.node_sound_stone_defaults(), + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true +} -minetest.register_node(":technic:uranium_block", { +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}, - sounds = default.node_sound_stone_defaults() -}) + 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 +} -minetest.register_node(":technic:chromium_block", { +local chromium_block_def = { description = S("Chromium Block"), tiles = { "technic_chromium_block.png" }, is_ground_content = true, - groups = {cracky=1, level=2}, - sounds = default.node_sound_stone_defaults() -}) + 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 +} -minetest.register_node(":technic:zinc_block", { +local zinc_block_def = { description = S("Zinc Block"), tiles = { "technic_zinc_block.png" }, is_ground_content = true, - groups = {cracky=1, level=2}, - sounds = default.node_sound_stone_defaults() -}) + 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 +} -minetest.register_node(":technic:lead_block", { +local lead_block_def = { description = S("Lead Block"), tiles = { "technic_lead_block.png" }, is_ground_content = true, - groups = {cracky=1, level=2}, - sounds = default.node_sound_stone_defaults() -}) + 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 +} -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.register_node(":technic:cast_iron_block", { +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 = default.node_sound_stone_defaults() -}) + sounds = sounds.node_sound_stone_defaults(), + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true +} -minetest.register_node(":technic:carbon_steel_block", { +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 = default.node_sound_stone_defaults() -}) + sounds = sounds.node_sound_stone_defaults(), + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true +} -minetest.register_node(":technic:stainless_steel_block", { +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 = default.node_sound_stone_defaults() -}) + sounds = sounds.node_sound_stone_defaults(), + _mcl_hardness = 3, + _mcl_blast_resistance = 3, + _mcl_silk_touch_drop = true +} -minetest.register_craft({ - output = 'technic:granite_bricks 4', - recipe = { - {'technic:granite','technic:granite'}, - {'technic:granite','technic:granite'} - } -}) + + +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", { + 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 = sounds.node_sound_stone_defaults(), + }) +end + +minetest.register_node( ":technic:marble", marble_def) + +minetest.register_node( ":technic:marble_bricks", marble_bricks_def) + +minetest.register_node(":technic:uranium_block", uranium_block_def) + +minetest.register_node(":technic:chromium_block", chromium_block_def) + +minetest.register_node(":technic:zinc_block", zinc_block_def) + +minetest.register_node(":technic:lead_block", lead_block_def) + +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", cast_iron_block_def) + +minetest.register_node(":technic:carbon_steel_block", carbon_steel_block_def) + +minetest.register_node(":technic:stainless_steel_block", stainless_steel_block_def) + +if minetest.get_modpath("default") then + minetest.register_craft({ + output = 'technic:granite_bricks 4', + recipe = { + {granite_ingredient,granite_ingredient}, + {granite_ingredient,granite_ingredient} + } + }) +end minetest.register_craft({ output = 'technic:marble_bricks 4', @@ -172,33 +256,35 @@ local function for_each_registered_node(action) end end -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 +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, { - 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/oregen.lua b/technic_worldgen/oregen.lua index 4fd41fd..6a93ffd 100644 --- a/technic_worldgen/oregen.lua +++ b/technic_worldgen/oregen.lua @@ -1,148 +1,123 @@ 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 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" +-- 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({ - 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 = uranium_y_min, + y_max = uranium_y_max, + 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 = chromium_y_min, + y_max = chromium_y_max, + 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 = zinc_y_min, + y_max = zinc_y_max, + 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 = lead_y_min, + y_max = lead_y_max, + noise_params = lead_params, + noise_threshold = lead_threshold, }) -- Sulfur @@ -150,78 +125,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..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}, - sounds = default.node_sound_defaults(), + 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}, - sounds = default.node_sound_wood_defaults(), + 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}, - sounds = default.node_sound_wood_defaults(), + 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 = default.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 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 a18b4f7..d12fe53 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,mineclonia,mineclone5 \ No newline at end of file diff --git a/wrench/support.lua b/wrench/support.lua index 78ffa03..9be4c3e 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_ingredient] = { lists = {"main"}, }, ["default:chest_locked"] = {