diff --git a/.gitmodules b/.gitmodules index 57fa04136..b0c3b9336 100644 --- a/.gitmodules +++ b/.gitmodules @@ -229,9 +229,6 @@ [submodule "builder/mods_src/libs/sfcraftguide"] path = builder/mods_src/libs/sfcraftguide url = https://github.com/dacmot/sfcraftguide.git -[submodule "builder/mods_src/libs/sound_api"] - path = builder/mods_src/libs/sound_api - url = https://github.com/mt-mods/sound_api.git [submodule "builder/mods_src/libs/ediblestuff_api"] path = builder/mods_src/libs/ediblestuff_api url = https://github.com/Lazerbeak12345/ediblestuff_api.git @@ -256,3 +253,6 @@ [submodule "builder/mods_src/tools/supercub"] path = builder/mods_src/tools/supercub url = https://github.com/APercy/supercub.git +[submodule "builder/mods_src/libs/xcompat"] + path = builder/mods_src/libs/xcompat + url = https://github.com/mt-mods/xcompat.git diff --git a/builder/lib-config-whynot.sh b/builder/lib-config-whynot.sh index 2e065af71..c750547a5 100644 --- a/builder/lib-config-whynot.sh +++ b/builder/lib-config-whynot.sh @@ -6,10 +6,6 @@ declare -Ag BRANCHES=( [minetest_game/minetest_game]=origin/stable-5 # Stay on stable version [flora_ores/farming]=0b06c7cd450c5ec9a76b3c22a9c57f06e4f8a7c2 # freeze due to incompatibility with milk buckets - [decor/basic_materials]=1009295ee68c490e388302d0600f293685226b67 # freeze until addition of xcompat - [decor/home_workshop_modpack]=4b5e58331c8ecf6d6f1f23b5e8b8b167dc772069 # freeze until addition of xcompat - [decor/homedecor_modpack]=52f7c54702c58bccec2877cb67dbcfa87cd83ace # freeze until addition of xcompat - [libs/sound_api]=d13501cc10059149cde3c266df7e623556e9a5ef # freeze until addition of xcompat ) # diff --git a/builder/mods_src/decor/basic_materials b/builder/mods_src/decor/basic_materials index 1009295ee..800310c0f 160000 --- a/builder/mods_src/decor/basic_materials +++ b/builder/mods_src/decor/basic_materials @@ -1 +1 @@ -Subproject commit 1009295ee68c490e388302d0600f293685226b67 +Subproject commit 800310c0fa2522d04409d95676d1d0e9ed3964db diff --git a/builder/mods_src/decor/home_workshop_modpack b/builder/mods_src/decor/home_workshop_modpack index 4b5e58331..c3f11977c 160000 --- a/builder/mods_src/decor/home_workshop_modpack +++ b/builder/mods_src/decor/home_workshop_modpack @@ -1 +1 @@ -Subproject commit 4b5e58331c8ecf6d6f1f23b5e8b8b167dc772069 +Subproject commit c3f11977c710f6ef626f1f11d2920fbdb773a187 diff --git a/builder/mods_src/decor/homedecor_modpack b/builder/mods_src/decor/homedecor_modpack index 52f7c5470..d400e421c 160000 --- a/builder/mods_src/decor/homedecor_modpack +++ b/builder/mods_src/decor/homedecor_modpack @@ -1 +1 @@ -Subproject commit 52f7c54702c58bccec2877cb67dbcfa87cd83ace +Subproject commit d400e421cefef866cdec217e4c6c81b1328c8eab diff --git a/builder/mods_src/libs/sound_api b/builder/mods_src/libs/sound_api deleted file mode 160000 index d13501cc1..000000000 --- a/builder/mods_src/libs/sound_api +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d13501cc10059149cde3c266df7e623556e9a5ef diff --git a/builder/mods_src/libs/xcompat b/builder/mods_src/libs/xcompat new file mode 160000 index 000000000..3da43ebf4 --- /dev/null +++ b/builder/mods_src/libs/xcompat @@ -0,0 +1 @@ +Subproject commit 3da43ebf4e2338137379c8c2d705da2a536115fa diff --git a/mod_sources.txt b/mod_sources.txt index cd3617379..a5d37161b 100644 --- a/mod_sources.txt +++ b/mod_sources.txt @@ -20,7 +20,7 @@ origin https://github.com/Ezhh/abriglass/ (fetch) Mod: decor/abriglass origin https://github.com/mt-mods/basic_materials (fetch) -* 1009295ee68c490e388302d0600f293685226b67 Add mcl_copper support (#22) +* 800310c0fa2522d04409d95676d1d0e9ed3964db nodes aren't ground content (#26) Mod: decor/basic_materials origin https://github.com/Napiophelios/campfire (fetch) @@ -44,11 +44,11 @@ origin https://github.com/HybridDog/heads (fetch) Mod: decor/heads origin https://github.com/mt-mods/home_workshop_modpack (fetch) -* 4b5e58331c8ecf6d6f1f23b5e8b8b167dc772069 nodes that aren't ground content (#16) +* c3f11977c710f6ef626f1f11d2920fbdb773a187 remove default checks from before loading craft files (#19) Mod: decor/home_workshop_modpack origin https://github.com/mt-mods/homedecor_modpack (fetch) -* 52f7c54702c58bccec2877cb67dbcfa87cd83ace Fix particlespawner removal when digging fancy fire +* d400e421cefef866cdec217e4c6c81b1328c8eab Replace `homedecor_blanktile.png` w/ engine provided `blank.png` (#69) Mod: decor/homedecor_modpack origin https://codeberg.org/Dacmot/minetest-laptop.git (fetch) @@ -155,9 +155,9 @@ origin https://github.com/dacmot/sfcraftguide.git (fetch) * ed75268b9e4a7b04df2c942c1bc389b31ecbde4a Add supported games Mod: libs/sfcraftguide -origin https://github.com/mt-mods/sound_api.git (fetch) -* d13501cc10059149cde3c266df7e623556e9a5ef Avoid crash when sound_api function for a key is undefined (#4) -Mod: libs/sound_api +origin https://github.com/mt-mods/xcompat.git (fetch) +* 3da43ebf4e2338137379c8c2d705da2a536115fa adds stuff for home workshop game agnostic pr (#16) +Mod: libs/xcompat origin https://github.com/Treer/cloudlands/ (fetch) * aed3ab8306ef92a47f228c7ea4577eae7bb00e67 fix ancient portalstone upgrade diff --git a/mods/decor/basic_materials/.luacheckrc b/mods/decor/basic_materials/.luacheckrc index c1a52ae88..1dabf6772 100644 --- a/mods/decor/basic_materials/.luacheckrc +++ b/mods/decor/basic_materials/.luacheckrc @@ -3,5 +3,5 @@ globals = { } read_globals = { - "default", + "default", "xcompat", } \ No newline at end of file diff --git a/mods/decor/basic_materials/README.md b/mods/decor/basic_materials/README.md index faa344672..919e4f020 100644 --- a/mods/decor/basic_materials/README.md +++ b/mods/decor/basic_materials/README.md @@ -20,11 +20,4 @@ mod that adds basic material nodes and items ### Option 3: use git * `git clone https://github.com/mt-mods/basic_materials.git` -* `cd basic_materials` -* `git submodule init` -* `git submodule update` - -to update please use the following commands starting inside the mod directory - -* `git submodule sync` -* `git submodule update` \ No newline at end of file +* `cd basic_materials` \ No newline at end of file diff --git a/mods/decor/basic_materials/crafts.lua b/mods/decor/basic_materials/crafts.lua index 55bd58c9d..0f24e1104 100644 --- a/mods/decor/basic_materials/crafts.lua +++ b/mods/decor/basic_materials/crafts.lua @@ -1,139 +1,4 @@ -local materials = { - dirt = "default:dirt", - sand = "default:sand", - gravel = "default:gravel", - copper_ingot = "default:copper_ingot", - steel_ingot = "default:steel_ingot", - gold_ingot = "default:gold_ingot", - tin_ingot = "default:tin_ingot", - mese_crystal_fragment = "default:mese_crystal_fragment", - torch = "default:torch", - diamond = "default:diamond", - clay_lump = "default:clay_lump", - water_bucket = "bucket:bucket_water", - empty_bucket = "bucket:bucket_empty", - dye_dark_grey = "dye:dark_grey", - silicon = "mesecons_materials:silicon", -} - -if minetest.get_modpath("moreores") then - materials.silver_ingot = "moreores:silver_ingot" -end - -if minetest.get_modpath("technic") then - materials.lead_ingot = "technic:lead_ingot" - materials.carbon_steel_ingot = "technic:carbon_steel_ingot" - materials.stainless_steel_ingot = "technic:stainless_steel_ingot" -end - -if minetest.get_modpath("aloz") then - materials.aluminum_ingot = "aloz:aluminum_ingot" -end - -if minetest.get_modpath("techage") then - materials.aluminum_ingot = "techage:aluminum" -end - -if minetest.get_modpath("mcl_core") then - materials = { - dirt = "mcl_core:dirt", - sand = "mcl_core:sand", - gravel = "mcl_core:gravel", - steel_ingot = "mcl_core:iron_ingot", - gold_ingot = "mcl_core:gold_ingot", - mese_crystal_fragment = "mesecons:redstone", - torch = "mcl_torches:torch", - diamond = "mcl_core:diamond", - clay_lump = "mcl_core:clay_lump", - water_bucket = "mcl_buckets:bucket_water", - empty_bucket = "mcl_buckets:bucket_empty", - dye_dark_grey = "mcl_dye:dark_grey", - -- Use iron where no equivalent - copper_ingot = "mcl_core:iron_ingot", - tin_ingot = "mcl_core:iron_ingot", - silver_ingot = "mcl_core:iron_ingot", - silicon = "mesecons_materials:silicon", - } - if minetest.get_modpath("mcl_copper") then - materials.copper_ingot = "mcl_copper:copper_ingot" - end -elseif minetest.get_modpath("fl_ores") and minetest.get_modpath("fl_stone") then - materials = { - dirt = "fl_topsoil:dirt", - sand = "fl_stone:sand", - gravel = "fl_topsoil:gravel", - steel_ingot = "fl_ores:iron_ingot", - gold_ingot = "fl_ores:gold_ingot", - mese_crystal_fragment = "fl_ores:iron_ingot", - torch = "fl_light_sources:torch", - diamond = "fl_ores:diamond", - clay_lump = "fl_bricks:clay_lump", - water_bucket = "fl_bucket:bucket_water", - empty_bucket = "fl_bucket:bucket", - dye_dark_grey = "fl_dyes:dark_grey_dye", - copper_ingot = "fl_ores:copper_ingot", - tin_ingot = "fl_ores:tin_ingot", - silver_ingot = "fl_ores:iron_ingot", - silicon = "mesecons_materials:silicon", - } -elseif minetest.get_modpath("rp_default") then - materials = { - dirt = "rp_default:dirt", - sand = "rp_default:sand", - gravel = "rp_default:gravel", - steel_ingot = "rp_default:ingot_steel", - gold_ingot = "rp_default:ingot_gold", - mese_crystal_fragment = "rp_default:ingot_steel", - torch = "rp_default:torch", - diamond = "rp_default:pearl", - clay_lump = "rp_default:ingot_steel", - water_bucket = "rp_default:swamp_dirt", - empty_bucket = "rp_default:dirt", - dye_dark_grey = "rp_default:ingot_steel", - copper_ingot = "rp_default:ingot_copper", - tin_ingot = "rp_default:ingot_tin", - silver_ingot = "rp_default:ingot_steel", - silicon = "rp_default:ingot_steel", - } -elseif minetest.get_modpath("hades_core") then - materials = { - dirt = "hades_core:dirt", - sand = "hades_core:fertile_sand", - gravel = "hades_core:gravel", - steel_ingot = "hades_core:steel_ingot", - gold_ingot = "hades_core:gold_ingot", - mese_crystal_fragment = "hades_core:mese_crystal_fragment", - torch = "hades_torches:torch", - diamond = "hades_core:diamond", - clay_lump = "hades_core:clay_lump", - dye_dark_grey = "hades_dye:dark_grey", - copper_ingot = "hades_core:copper_ingot", - tin_ingot = "hades_core:tin_ingot", - --[[ - Since hades doesnt have buckets or water for the user, - using dirt from near water to pull the water out - ]] - water_bucket = "hades_core:dirt", - empty_bucket = "hades_core:fertile_sand", - -- Set this to steel unless hadesextraores is present - silver_ingot = "hades_core:steel_ingot", - silicon = "hades_materials:silicon", - } - - if minetest.get_modpath("hades_bucket") then - materials["water_bucket"] = "hades_bucket:bucket_water" - materials["empty_bucket"] = "hades_bucket:bucket_empty" - end - if minetest.get_modpath("hades_extraores") then - materials["silver_ingot"] = "hades_extraores:silver_ingot" - materials["aluminum_ingot"] = "hades_extraores:aluminum_ingot" - end - if minetest.get_modpath("hades_technic") then - materials.lead_ingot = "hades_technic:lead_ingot" - materials.carbon_steel_ingot = "hades_technic:carbon_steel_ingot" - materials.stainless_steel_ingot = "hades_technic:stainless_steel_ingot" - end -end +local materials = xcompat.materials local have_hades_materials = minetest.get_modpath("hades_materials") @@ -527,7 +392,7 @@ register_craft({ if not have_hades_materials then register_craft( { - output = materials.silicon.." 4", + output = "basic_materials:silicon 4", recipe = { {materials.sand, materials.sand}, {materials.sand, materials.steel_ingot}, @@ -538,8 +403,8 @@ end register_craft( { output = "basic_materials:ic 4", recipe = { - {materials.silicon, materials.silicon}, - {materials.silicon, materials.copper_ingot}, + {"basic_materials:silicon", "basic_materials:silicon"}, + {"basic_materials:silicon", materials.copper_ingot}, }, }) diff --git a/mods/decor/basic_materials/mod.conf b/mods/decor/basic_materials/mod.conf index 587dc1501..d14197bc5 100644 --- a/mods/decor/basic_materials/mod.conf +++ b/mods/decor/basic_materials/mod.conf @@ -1,3 +1,4 @@ name = basic_materials +depends = xcompat optional_depends = moreores, default, mesecons_materials, dye, bucket, fl_stone, fl_trees, mcl_sounds, hades_core, hades_sounds, hades_materials, hades_dye, hades_bucket, hades_extraores, hades_mesecons_materials, aloz, rp_crafting, mcl_core, mcl_copper min_minetest_version = 5.2.0 diff --git a/mods/decor/basic_materials/nodes.lua b/mods/decor/basic_materials/nodes.lua index ef10f433b..a40d1f544 100644 --- a/mods/decor/basic_materials/nodes.lua +++ b/mods/decor/basic_materials/nodes.lua @@ -1,11 +1,11 @@ local S = minetest.get_translator("basic_materials") -local sound_api = dofile(basic_materials.modpath .. "/sound_api_core/init.lua") +local sound_api = xcompat.sounds local chains_sbox = {type = "fixed",fixed = { -0.1, -0.5, -0.1, 0.1, 0.5, 0.1 }} minetest.register_node("basic_materials:cement_block", { description = S("Cement"), tiles = {"basic_materials_cement_block.png"}, - is_ground_content = true, + is_ground_content = false, groups = {cracky=2, dig_stone = 1, pickaxey=5}, _mcl_hardness=1.6, sounds = sound_api.node_sound_stone_defaults(), @@ -14,6 +14,7 @@ minetest.register_node("basic_materials:cement_block", { minetest.register_node("basic_materials:concrete_block", { description = S("Concrete Block"), tiles = {"basic_materials_concrete_block.png",}, + is_ground_content = false, groups = {cracky=1, concrete=1, dig_stone = 1, pickaxey=5}, _mcl_hardness=1.6, sounds = sound_api.node_sound_stone_defaults(), @@ -29,6 +30,7 @@ minetest.register_node("basic_materials:chain_steel", { sunlight_propagates = true, paramtype = "light", inventory_image = "basic_materials_chain_steel_inv.png", + is_ground_content = false, groups = {cracky=3, dig_stone = 1, pickaxey=5}, _mcl_hardness=1.6, selection_box = chains_sbox, @@ -44,6 +46,7 @@ minetest.register_node("basic_materials:chain_brass", { sunlight_propagates = true, paramtype = "light", inventory_image = "basic_materials_chain_brass_inv.png", + is_ground_content = false, groups = {cracky=3, dig_stone = 1, pickaxey=5}, _mcl_hardness=1.6, selection_box = chains_sbox, diff --git a/mods/decor/building_blocks/node_stairs.lua b/mods/decor/building_blocks/node_stairs.lua index 8304632ea..349c4bcbc 100644 --- a/mods/decor/building_blocks/node_stairs.lua +++ b/mods/decor/building_blocks/node_stairs.lua @@ -13,6 +13,8 @@ local function building_blocks_stairs(nodename, def) def._mcl_hardness=1.6 end + def.is_ground_content = def.is_ground_content == true + minetest.register_node(nodename, def) if minetest.get_modpath("moreblocks") then local mod, name = nodename:match("(.*):(.*)") @@ -31,7 +33,7 @@ building_blocks_stairs("building_blocks:grate", { tiles = {"building_blocks_grate.png"}, paramtype = "light", sunlight_propagates = true, - is_ground_content = true, + is_ground_content = false, use_texture_alpha = "clip", groups = {cracky=1, dig_generic=3}, _sound_def = { @@ -44,7 +46,7 @@ building_blocks_stairs("building_blocks:smoothglass", { tiles = {"building_blocks_sglass.png"}, paramtype = "light", sunlight_propagates = true, - is_ground_content = true, + is_ground_content = false, use_texture_alpha = "clip", groups = {snappy=3,cracky=3,oddly_breakable_by_hand=3}, _sound_def = { @@ -57,7 +59,7 @@ building_blocks_stairs("building_blocks:woodglass", { tiles = {"building_blocks_wglass.png"}, paramtype = "light", sunlight_propagates = true, - is_ground_content = true, + is_ground_content = false, use_texture_alpha = "clip", groups = {snappy=3,cracky=3,oddly_breakable_by_hand=3}, _sound_def = { @@ -68,20 +70,21 @@ building_blocks_stairs("building_blocks:woodglass", { building_blocks_stairs("building_blocks:Adobe", { tiles = {"building_blocks_Adobe.png"}, description = S("Adobe"), - is_ground_content = true, + is_ground_content = false, groups = {crumbly=3, dig_stone=2}, _sound_def = { key = "node_sound_stone_defaults", }, }) -local grasstex = {"[combine:16x16^[noalpha^[colorize:#006400"} -if minetest.get_modpath("default") then - grasstex = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"} -end +local grasstex = { + homedecor.textures.grass.top, + homedecor.textures.grass.dirt, + homedecor.textures.grass.side +} building_blocks_stairs("building_blocks:fakegrass", { tiles = grasstex, description = S("Fake Grass"), - is_ground_content = true, + is_ground_content = false, groups = {crumbly=3, dig_sand=3}, _sound_def = { key = "node_sound_dirt_defaults", @@ -89,7 +92,7 @@ building_blocks_stairs("building_blocks:fakegrass", { }) building_blocks_stairs("building_blocks:hardwood", { tiles = {"building_blocks_hardwood.png"}, - is_ground_content = true, + is_ground_content = false, description = S("Hardwood"), groups = {choppy=1,flammable=1, dig_tree=1}, _sound_def = { @@ -98,7 +101,7 @@ building_blocks_stairs("building_blocks:hardwood", { }) building_blocks_stairs("building_blocks:Roofing", { tiles = {"building_blocks_Roofing.png"}, - is_ground_content = true, + is_ground_content = false, description = S("Roof block"), groups = {snappy=3, dig_generic=4}, _sound_def = { @@ -108,7 +111,7 @@ building_blocks_stairs("building_blocks:Roofing", { building_blocks_stairs("building_blocks:Tar", { description = S("Tar"), tiles = {"building_blocks_tar.png"}, - is_ground_content = true, + is_ground_content = false, groups = {crumbly=1, tar_block = 1, dig_generic=4}, _sound_def = { key = "node_sound_stone_defaults", @@ -117,7 +120,7 @@ building_blocks_stairs("building_blocks:Tar", { building_blocks_stairs("building_blocks:Marble", { description = S("Marble"), tiles = {"building_blocks_marble.png"}, - is_ground_content = true, + is_ground_content = false, groups = {cracky=3, marble = 1, dig_stone=2}, _sound_def = { key = "node_sound_stone_defaults", @@ -139,16 +142,13 @@ minetest.register_node("building_blocks:brobble_spread", { fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2}, }, sunlight_propagates = true, - is_ground_content = true, + is_ground_content = false, groups = {crumbly=3, dig_generic=4, handy=1}, _mcl_hardness=0.6 }) if not minetest.get_modpath("moreblocks") or not minetest.get_modpath("gloopblocks") then - local graveltex = "[combine:16x16^[noalpha^[colorize:#3a3b3c" - if minetest.get_modpath("default") then - graveltex = "default_gravel.png" - end + local graveltex = homedecor.textures.gravel minetest.register_node("building_blocks:gravel_spread", { drawtype = "raillike", description = S("Gravel Spread"), @@ -162,7 +162,7 @@ if not minetest.get_modpath("moreblocks") or not minetest.get_modpath("gloopbloc fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2}, }, sunlight_propagates = true, - is_ground_content = true, + is_ground_content = false, groups = {crumbly=2, dig_generic=4, handy=1}, _mcl_hardness=0.6, _sound_def = { @@ -184,7 +184,7 @@ minetest.register_node("building_blocks:Tarmac_spread", { fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2}, }, sunlight_propagates = true, - is_ground_content = true, + is_ground_content = false, groups = {cracky=3, dig_generic=4, pickaxey=5}, _mcl_hardness=1.6, _sound_def = { @@ -204,7 +204,7 @@ minetest.register_node("building_blocks:terrycloth_towel", { fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2}, }, sunlight_propagates = true, - is_ground_content = true, + is_ground_content = false, groups = {crumbly=3, dig_generic=4, handy=1}, _mcl_hardness=0.6 }) @@ -228,7 +228,7 @@ minetest.register_node("building_blocks:BWtile", { fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2}, }, sunlight_propagates = true, - is_ground_content = true, + is_ground_content = false, groups = {crumbly=3, dig_generic=4, handy=1}, _mcl_hardness=0.6 }) @@ -245,7 +245,7 @@ minetest.register_node("building_blocks:Fireplace", { paramtype2 = "facedir", light_source = minetest.LIGHT_MAX, sunlight_propagates = true, - is_ground_content = true, + is_ground_content = false, groups = {cracky=2, dig_generic=4, pickaxey=5}, _mcl_hardness=1.6, _sound_def = { diff --git a/mods/decor/fake_fire/init.lua b/mods/decor/fake_fire/init.lua index 39e15f568..b718c821f 100644 --- a/mods/decor/fake_fire/init.lua +++ b/mods/decor/fake_fire/init.lua @@ -146,6 +146,7 @@ minetest.register_node("fake_fire:ice_fire", { paramtype = "light", paramtype2 = "facedir", groups = {dig_immediate=3, not_in_creative_inventory=1, dig_generic=3, handy=1}, + is_ground_content = false, _mcl_hardness=0.6, sunlight_propagates = true, buildable_to = true, @@ -177,7 +178,7 @@ local sbox = { fixed = { -8/16, -8/16, -8/16, 8/16, -6/16, 8/16}, } -local wtex = homedecor.textures.default_junglewood +local wtex = homedecor.textures.wood.jungle.planks minetest.register_node("fake_fire:fancy_fire", { inventory_image = "fancy_fire_inv.png", @@ -188,6 +189,7 @@ minetest.register_node("fake_fire:fancy_fire", { paramtype2 = "facedir", use_texture_alpha = "clip", groups = {oddly_breakable_by_hand=3, flammable=0, handy=1}, + is_ground_content = false, _mcl_hardness=0.6, sunlight_propagates = true, light_source = 13, @@ -234,6 +236,7 @@ minetest.register_node("fake_fire:embers", { }, light_source = 9, groups = {crumbly=3, dig_stone=2, handy=1}, + is_ground_content = false, _mcl_hardness=0.6, paramtype = "light", _sound_def = { @@ -266,6 +269,7 @@ for _, mat in ipairs(materials) do description = desc, tiles = {tex.."^chimney_top.png", tex}, groups = {snappy=3, dig_stone=2, handy=1}, + is_ground_content = false, _mcl_hardness=0.6, paramtype = "light", _sound_def = { diff --git a/mods/decor/home_vending_machines/api.lua b/mods/decor/home_vending_machines/api.lua index 3addcc7b5..278c42f07 100644 --- a/mods/decor/home_vending_machines/api.lua +++ b/mods/decor/home_vending_machines/api.lua @@ -12,7 +12,7 @@ local function reg_simple(name, def) tiles = def.tiles, paramtype = "light", paramtype2 = "facedir", - groups = def.groups or {snappy=3}, + groups = def.groups or {snappy=3, dig_tree=2}, is_ground_content = false, selection_box = { type = "fixed", diff --git a/mods/decor/home_vending_machines/crafts.lua b/mods/decor/home_vending_machines/crafts.lua index 760439cf1..c044e5fe4 100644 --- a/mods/decor/home_vending_machines/crafts.lua +++ b/mods/decor/home_vending_machines/crafts.lua @@ -1,32 +1,26 @@ -if minetest.get_modpath("default") then - if minetest.get_modpath("dye") then - minetest.register_craft({ - output = "home_workshop_misc:soda_machine", - recipe = { - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, - {"default:steel_ingot", "dye:red", "default:steel_ingot"}, - {"default:steel_ingot", "default:copperblock", "default:steel_ingot"}, - }, - }) - end - if minetest.get_modpath("vessels") then - minetest.register_craft({ - output = "home_vending_machines:drink_machine", - recipe = { - {"default:steel_ingot", "group:vessel", "default:steel_ingot"}, - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, - {"default:steel_ingot", "default:copperblock", "default:steel_ingot"}, - }, - }) - end - if minetest.global_exists("farming") and farming.mod == "redo" then - minetest.register_craft({ - output = "home_vending_machines:sweet_machine", - recipe = { - {"default:steel_ingot", "group:food_sugar", "default:steel_ingot"}, - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, - {"default:steel_ingot", "default:copperblock", "default:steel_ingot"}, - }, - }) - end -end +local materials = xcompat.materials + +minetest.register_craft({ + output = "home_workshop_misc:soda_machine", + recipe = { + {materials.steel_ingot, materials.steel_ingot, materials.steel_ingot}, + {materials.steel_ingot, materials.dye_red, materials.steel_ingot}, + {materials.steel_ingot, materials.copper_block, materials.steel_ingot}, + }, +}) +minetest.register_craft({ + output = "home_vending_machines:drink_machine", + recipe = { + {materials.steel_ingot, "group:vessel", materials.steel_ingot}, + {materials.steel_ingot, materials.steel_ingot, materials.steel_ingot}, + {materials.steel_ingot, materials.copper_block, materials.steel_ingot}, + }, +}) +minetest.register_craft({ + output = "home_vending_machines:sweet_machine", + recipe = { + {materials.steel_ingot, "group:food_sugar", materials.steel_ingot}, + {materials.steel_ingot, materials.steel_ingot, materials.steel_ingot}, + {materials.steel_ingot, materials.copper_block, materials.steel_ingot}, + }, +}) \ No newline at end of file diff --git a/mods/decor/home_vending_machines/mod.conf b/mods/decor/home_vending_machines/mod.conf index b39b6363a..e88c44059 100644 --- a/mods/decor/home_vending_machines/mod.conf +++ b/mods/decor/home_vending_machines/mod.conf @@ -1,2 +1,3 @@ name = home_vending_machines +depends = xcompat optional_depends = screwdriver, default, dye, vessels, farming \ No newline at end of file diff --git a/mods/decor/home_workshop_misc/crafts.lua b/mods/decor/home_workshop_misc/crafts.lua index 46b082695..743dcb7ca 100644 --- a/mods/decor/home_workshop_misc/crafts.lua +++ b/mods/decor/home_workshop_misc/crafts.lua @@ -1,17 +1,19 @@ +local materials = xcompat.materials + minetest.register_craft({ output = "home_workshop_misc:tool_cabinet", recipe = { - { "basic_materials:motor", "default:axe_steel", "default:pick_steel" }, - { "default:steel_ingot", "home_workshop_misc:drawer_small", "default:steel_ingot" }, - { "default:steel_ingot", "home_workshop_misc:drawer_small", "default:steel_ingot" } + { "basic_materials:motor", materials.axe_steel, materials.pick_steel }, + { materials.steel_ingot, "home_workshop_misc:drawer_small", materials.steel_ingot }, + { materials.steel_ingot, "home_workshop_misc:drawer_small", materials.steel_ingot } }, }) minetest.register_craft({ output = "home_workshop_misc:beer_tap", recipe = { - { "group:stick", "default:steel_ingot", "group:stick" }, - { "basic_materials:steel_bar", "default:steel_ingot", "basic_materials:steel_bar" }, - { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" } + { "group:stick", materials.steel_ingot, "group:stick" }, + { "basic_materials:steel_bar", materials.steel_ingot, "basic_materials:steel_bar" }, + { materials.steel_ingot, materials.steel_ingot, materials.steel_ingot } }, }) \ No newline at end of file diff --git a/mods/decor/home_workshop_misc/init.lua b/mods/decor/home_workshop_misc/init.lua index 1b472a18d..e0ba6248c 100644 --- a/mods/decor/home_workshop_misc/init.lua +++ b/mods/decor/home_workshop_misc/init.lua @@ -18,7 +18,7 @@ minetest.register_node("home_workshop_misc:tool_cabinet", { paramtype2="facedir", inventory_image = "home_workshop_misc_tool_cabinet_inv.png", on_rotate = minetest.get_modpath("screwdriver") and screwdriver.rotate_simple or nil, - groups = { snappy=3 }, + groups = { snappy=3, dig_tree=2 }, is_ground_content = false, expand = { top="placeholder" }, inventory = { @@ -37,7 +37,7 @@ minetest.register_node("home_workshop_misc:beer_tap", { inventory_image = "home_workshop_misc_beertap_inv.png", paramtype = "light", paramtype2 = "facedir", - groups = { snappy=3 }, + groups = { snappy=3, dig_tree=2 }, is_ground_content = false, walkable = false, selection_box = { @@ -80,7 +80,7 @@ minetest.register_node("home_workshop_misc:beer_mug", { groups = { snappy=3, oddly_breakable_by_hand=3 }, is_ground_content = false, walkable = false, - sounds = default and default.node_sound_glass_defaults() or nil, + sounds = xcompat.sounds.node_sound_glass_defaults(), selection_box = beer_cbox, on_use = function(itemstack, user, pointed_thing) if not minetest.is_creative_enabled(user:get_player_name()) then @@ -100,7 +100,7 @@ else end local MODPATH = minetest.get_modpath("home_workshop_misc") -if minetest.get_modpath("default") and minetest.get_modpath("basic_materials") then +if minetest.get_modpath("basic_materials") then dofile(MODPATH.."/crafts.lua") end diff --git a/mods/decor/home_workshop_misc/mod.conf b/mods/decor/home_workshop_misc/mod.conf index b3958bbfd..f5bccbfeb 100644 --- a/mods/decor/home_workshop_misc/mod.conf +++ b/mods/decor/home_workshop_misc/mod.conf @@ -1,2 +1,3 @@ name = home_workshop_misc +depends = xcompat optional_depends = currency, screwdriver, homedecor_common, default diff --git a/mods/decor/homedecor_bathroom/init.lua b/mods/decor/homedecor_bathroom/init.lua index c3e7fbb81..cd2e1e5ed 100644 --- a/mods/decor/homedecor_bathroom/init.lua +++ b/mods/decor/homedecor_bathroom/init.lua @@ -2,8 +2,8 @@ local S = minetest.get_translator("homedecor_bathroom") local sc_disallow = minetest.get_modpath("screwdriver") and screwdriver.disallow or nil -local wood_tex = homedecor.textures.default_wood -local water_tex = homedecor.textures.water +local wood_tex = homedecor.textures.wood.apple.planks +local water_tex = homedecor.textures.water.tile homedecor.register("bathroom_tiles_dark", { description = S("Bathroom/kitchen tiles (dark)"), diff --git a/mods/decor/homedecor_bedroom/init.lua b/mods/decor/homedecor_bedroom/init.lua index b8666daa0..f0a6cddf6 100644 --- a/mods/decor/homedecor_bedroom/init.lua +++ b/mods/decor/homedecor_bedroom/init.lua @@ -2,7 +2,7 @@ local S = minetest.get_translator("homedecor_bedroom") local sc_disallow = minetest.get_modpath("screwdriver") and screwdriver.disallow or nil -local wood_tex, wool_tex = homedecor.textures.default_wood, homedecor.textures.wool_white +local wood_tex, wool_tex = homedecor.textures.wood.apple.planks, homedecor.textures.wool.white local bed_sbox = { type = "wallmounted", diff --git a/mods/decor/homedecor_climate_control/init.lua b/mods/decor/homedecor_climate_control/init.lua index 1d23e54ba..dbe2a0d0d 100644 --- a/mods/decor/homedecor_climate_control/init.lua +++ b/mods/decor/homedecor_climate_control/init.lua @@ -7,7 +7,7 @@ homedecor.register("air_conditioner", { mesh = "homedecor_ac.obj", tiles = { "homedecor_ac.png", - homedecor.textures.glass + homedecor.textures.glass.pane }, groups = { snappy = 3, dig_stone = 3 }, use_texture_alpha = "clip", diff --git a/mods/decor/homedecor_clocks/init.lua b/mods/decor/homedecor_clocks/init.lua index 790351104..854a4b509 100644 --- a/mods/decor/homedecor_clocks/init.lua +++ b/mods/decor/homedecor_clocks/init.lua @@ -1,12 +1,6 @@ local S = minetest.get_translator("homedecor_clocks") -local wood -if minetest.get_modpath("default") then - wood = "default_wood.png" -else - - wood = "[combine:16x16^[noalpha^[colorize:#563d2d" -end +local wood = homedecor.textures.wood.apple.planks local plastic_craft = { output = "homedecor:analog_clock_plastic 2", @@ -135,7 +129,7 @@ homedecor.register("grandfather_clock", { description = S("Grandfather Clock"), mesh = "homedecor_grandfather_clock.obj", tiles = { - homedecor.textures.glass, + homedecor.textures.glass.pane, "homedecor_grandfather_clock_face.png", homedecor.lux_wood, "homedecor_grandfather_clock_face_edge.png", diff --git a/mods/decor/homedecor_common/init.lua b/mods/decor/homedecor_common/init.lua index a579597bb..0b2190217 100644 --- a/mods/decor/homedecor_common/init.lua +++ b/mods/decor/homedecor_common/init.lua @@ -54,8 +54,7 @@ homedecor.color_dark_grey = 0xff606060 homedecor.color_med_grey = 0xffa0a0a0 -- load different handler subsystems -dofile(modpath.."/textures.lua") -dofile(modpath.."/materials.lua") +dofile(modpath.."/xcompat.lua") dofile(modpath.."/nodeboxes.lua") dofile(modpath.."/expansion.lua") dofile(modpath.."/furnaces.lua") diff --git a/mods/decor/homedecor_common/inventory.lua b/mods/decor/homedecor_common/inventory.lua index 75cfb89d9..d25b7fa3e 100644 --- a/mods/decor/homedecor_common/inventory.lua +++ b/mods/decor/homedecor_common/inventory.lua @@ -12,6 +12,22 @@ local default_can_dig = function(pos,player) return meta:get_inventory():is_empty("main") end +local default_can_interact_with_node = function(player, pos) + --if we have default, use it + if default then return default.can_interact_with_node(player, pos) end + + local owner = minetest.get_meta(pos):get_string("owner") or "" + + --check that we have a valid player + if not player or not player:is_player() then return false end + --check there privs for compat with areas + if minetest.check_player_privs(player, "protection_bypass") then return true end + --if a normal player, check if they are the owner + if owner == "" or owner == player:get_player_name() then return true end + + return false +end + local default_inventory_formspecs = { ["4"]="size[8,6]".. @@ -133,7 +149,7 @@ function homedecor.handle_inventory(name, def, original_def) local allow_move = def.allow_metadata_inventory_move def.allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) - if not default.can_interact_with_node(player, pos) then + if not default_can_interact_with_node(player, pos) then minetest.log("action", player:get_player_name().." tried to access a "..name.." belonging to " ..minetest.get_meta(pos):get_string("owner").." at "..minetest.pos_to_string(pos)) return 0 @@ -144,7 +160,7 @@ function homedecor.handle_inventory(name, def, original_def) local allow_put = def.allow_metadata_inventory_put def.allow_metadata_inventory_put = function(pos, listname, index, stack, player) - if not default.can_interact_with_node(player, pos) then + if not default_can_interact_with_node(player, pos) then minetest.log("action", player:get_player_name().." tried to access a "..name.." belonging to" ..minetest.get_meta(pos):get_string("owner").." at "..minetest.pos_to_string(pos)) return 0 @@ -155,7 +171,7 @@ function homedecor.handle_inventory(name, def, original_def) local allow_take = def.allow_metadata_inventory_take def.allow_metadata_inventory_take = function(pos, listname, index, stack, player) - if not default.can_interact_with_node(player, pos) then + if not default_can_interact_with_node(player, pos) then minetest.log("action", player:get_player_name().." tried to access a "..name.." belonging to" ..minetest.get_meta(pos):get_string("owner").." at ".. minetest.pos_to_string(pos)) return 0 @@ -166,7 +182,7 @@ function homedecor.handle_inventory(name, def, original_def) local can_dig = def.can_dig or default_can_dig def.can_dig = function(pos, player) - return default.can_interact_with_node(player, pos) and (can_dig and can_dig(pos, player) == true) + return default_can_interact_with_node(player, pos) and (can_dig and can_dig(pos, player) == true) end def.on_key_use = function(pos, player) diff --git a/mods/decor/homedecor_common/mod.conf b/mods/decor/homedecor_common/mod.conf index 321d86a9b..7a8bec851 100644 --- a/mods/decor/homedecor_common/mod.conf +++ b/mods/decor/homedecor_common/mod.conf @@ -1,4 +1,4 @@ name = homedecor_common description = Homedecor mod: common -depends = basic_materials, unifieddyes +depends = basic_materials, unifieddyes, xcompat optional_depends = screwdriver, hopper, default, creative, sound_api, fl_stone, fl_mapgen, i3, mcl_core, mcl_mapgen_core, void_essential, mapgen diff --git a/mods/decor/homedecor_common/registration.lua b/mods/decor/homedecor_common/registration.lua index 16abc545e..cb2b13cd5 100644 --- a/mods/decor/homedecor_common/registration.lua +++ b/mods/decor/homedecor_common/registration.lua @@ -19,6 +19,8 @@ function homedecor.register(name, original_def) def._mcl_hardness=1.6 end + def.is_ground_content = def.is_ground_content == true + def.drawtype = def.drawtype or (def.mesh and "mesh") or (def.node_box and "nodebox") diff --git a/mods/decor/homedecor_common/textures.lua b/mods/decor/homedecor_common/textures.lua deleted file mode 100644 index 77a883079..000000000 --- a/mods/decor/homedecor_common/textures.lua +++ /dev/null @@ -1,34 +0,0 @@ -homedecor.plain_wood = { name = "homedecor_generic_wood_plain.png", color = 0xffa76820 } -homedecor.mahogany_wood = { name = "homedecor_generic_wood_plain.png", color = 0xff7d2506 } -homedecor.white_wood = "homedecor_generic_wood_plain.png" -homedecor.dark_wood = { name = "homedecor_generic_wood_plain.png", color = 0xff39240f } -homedecor.lux_wood = { name = "homedecor_generic_wood_luxury.png", color = 0xff643f23 } - -homedecor.textures = { - glass = - "[combine:16x16:" .. - "0,0=\\[combine\\:1x16\\^[noalpha\\^[colorize\\:#ffffff:" .. - "0,0=\\[combine\\:16x1\\^[noalpha\\^[colorize\\:#ffffff:" .. - "0,15=\\[combine\\:16x1\\^[noalpha\\^[colorize\\:#ffffff:" .. - "15,0=\\[combine\\:1x16\\^[noalpha\\^[colorize\\:#ffffff", - default_wood = "[combine:16x16^[noalpha^[colorize:#654321", - default_junglewood = "[combine:16x16^[noalpha^[colorize:#563d2d", - water = "[combine:16x16^[noalpha^[colorize:#00008b", - wool_white = "[combine:16x16^[noalpha^[colorize:#ffffff", - wool_black = "[combine:16x16^[noalpha^[colorize:#000000", - wool_grey = "[combine:16x16^[noalpha^[colorize:#313b3c", - wool_dark_grey = "[combine:16x16^[noalpha^[colorize:#313b3c", -} - -if minetest.get_modpath("default") then - homedecor.textures = { - glass = "default_glass.png", - default_wood = "default_wood.png", - default_junglewood = "default_junglewood.png", - water = "default_water.png", - wool_white = "wool_white.png", - wool_black = "wool_black.png", - wool_grey = "wool_grey.png", - wool_dark_grey = "wool_dark_grey.png", - } -end \ No newline at end of file diff --git a/mods/decor/homedecor_common/textures/homedecor_blanktile.png b/mods/decor/homedecor_common/textures/homedecor_blanktile.png deleted file mode 100644 index dcdefebb1..000000000 Binary files a/mods/decor/homedecor_common/textures/homedecor_blanktile.png and /dev/null differ diff --git a/mods/decor/homedecor_common/xcompat.lua b/mods/decor/homedecor_common/xcompat.lua new file mode 100644 index 000000000..1efe2ba5d --- /dev/null +++ b/mods/decor/homedecor_common/xcompat.lua @@ -0,0 +1,8 @@ +homedecor.plain_wood = { name = "homedecor_generic_wood_plain.png", color = 0xffa76820 } +homedecor.mahogany_wood = { name = "homedecor_generic_wood_plain.png", color = 0xff7d2506 } +homedecor.white_wood = "homedecor_generic_wood_plain.png" +homedecor.dark_wood = { name = "homedecor_generic_wood_plain.png", color = 0xff39240f } +homedecor.lux_wood = { name = "homedecor_generic_wood_luxury.png", color = 0xff643f23 } + +homedecor.materials = xcompat.materials +homedecor.textures = xcompat.textures \ No newline at end of file diff --git a/mods/decor/homedecor_doors_and_gates/init.lua b/mods/decor/homedecor_doors_and_gates/init.lua index 4d646c42c..9650f2cbc 100644 --- a/mods/decor/homedecor_doors_and_gates/init.lua +++ b/mods/decor/homedecor_doors_and_gates/init.lua @@ -231,10 +231,10 @@ for i, g in ipairs(gate_list) do if gate == "picket" or gate == "picket_white" then tiles = { - "homedecor_blanktile.png", - "homedecor_blanktile.png", - "homedecor_blanktile.png", - "homedecor_blanktile.png", + "blank.png", + "blank.png", + "blank.png", + "blank.png", "homedecor_gate_"..gate.."_back.png", "homedecor_gate_"..gate.."_front.png" } @@ -247,6 +247,7 @@ for i, g in ipairs(gate_list) do paramtype = "light", use_texture_alpha = "clip", groups = {snappy=3, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, sounds = default.node_sound_wood_defaults(), paramtype2 = "facedir", @@ -709,4 +710,4 @@ minetest.register_lbm({ end minetest.set_node({x=pos.x, y=pos.y+1, z=pos.z}, {name = "doors:hidden"}) end -}) \ No newline at end of file +}) diff --git a/mods/decor/homedecor_exterior/init.lua b/mods/decor/homedecor_exterior/init.lua index 8a835f7c9..7fbc4668b 100644 --- a/mods/decor/homedecor_exterior/init.lua +++ b/mods/decor/homedecor_exterior/init.lua @@ -43,7 +43,7 @@ homedecor.register("barbecue", { minetest.register_alias("homedecor:barbecue_meat", "air") -local wood_tex = homedecor.textures.default_wood +local wood_tex = homedecor.textures.wood.apple.planks homedecor.register("doghouse", { mesh = "homedecor_doghouse.obj", @@ -288,8 +288,7 @@ homedecor.register("swing_rope", { selection_box = homedecor.nodebox.null }) -local water_tex = "default_water.png" -if not minetest.get_modpath("default") then water_tex = "[combine:16x16^[noalpha^[colorize:#00008b" end +local water_tex = homedecor.textures.water.tile local cobble_tex = minetest.registered_nodes["mapgen_stone"].tiles[1] local stone_drop = minetest.registered_nodes["mapgen_stone"].drop if stone_drop and type(stone_drop) == "string" then diff --git a/mods/decor/homedecor_fences/init.lua b/mods/decor/homedecor_fences/init.lua index 7d2e94891..6389d6911 100644 --- a/mods/decor/homedecor_fences/init.lua +++ b/mods/decor/homedecor_fences/init.lua @@ -49,8 +49,8 @@ end homedecor.register("fence_picket", { description = S("Unpainted Picket Fence"), tiles = { - "homedecor_blanktile.png", - "homedecor_blanktile.png", + "blank.png", + "blank.png", "homedecor_fence_picket.png", "homedecor_fence_picket.png", "homedecor_fence_picket_backside.png", @@ -85,8 +85,8 @@ homedecor.register("fence_picket", { homedecor.register("fence_picket_corner", { description = S("Unpainted Picket Fence Corner"), tiles = { - "homedecor_blanktile.png", - "homedecor_blanktile.png", + "blank.png", + "blank.png", "homedecor_fence_picket.png", "homedecor_fence_picket_backside.png", "homedecor_fence_picket_backside.png", @@ -113,8 +113,8 @@ homedecor.register("fence_picket_corner", { homedecor.register("fence_picket_white", { description = S("White Picket Fence"), tiles = { - "homedecor_blanktile.png", - "homedecor_blanktile.png", + "blank.png", + "blank.png", "homedecor_fence_picket_white.png", "homedecor_fence_picket_white.png", "homedecor_fence_picket_white_backside.png", @@ -149,8 +149,8 @@ homedecor.register("fence_picket_white", { homedecor.register("fence_picket_corner_white", { description = S("White Picket Fence Corner"), tiles = { - "homedecor_blanktile.png", - "homedecor_blanktile.png", + "blank.png", + "blank.png", "homedecor_fence_picket_white.png", "homedecor_fence_picket_white_backside.png", "homedecor_fence_picket_white_backside.png", diff --git a/mods/decor/homedecor_furniture/init.lua b/mods/decor/homedecor_furniture/init.lua index c40d6ada3..9c7e33afa 100644 --- a/mods/decor/homedecor_furniture/init.lua +++ b/mods/decor/homedecor_furniture/init.lua @@ -5,7 +5,7 @@ local ob_cbox = { fixed = { -0.5, -0.5, 0, 0.5, 0.5, 0.5 } } -local wood_tex = homedecor.textures.default_wood +local wood_tex = homedecor.textures.wood.apple.planks homedecor.register("openframe_bookshelf", { description = S("Bookshelf (open-frame)"), diff --git a/mods/decor/homedecor_kitchen/init.lua b/mods/decor/homedecor_kitchen/init.lua index f62d69ff5..526d8c596 100644 --- a/mods/decor/homedecor_kitchen/init.lua +++ b/mods/decor/homedecor_kitchen/init.lua @@ -145,7 +145,7 @@ homedecor.register("dishwasher_"..m, { }) end -local wood_tex = homedecor.textures.default_wood +local wood_tex = homedecor.textures.wood.apple.planks local cabinet_sides = "("..wood_tex.."^[transformR90)^homedecor_kitchen_cabinet_bevel.png" local cabinet_sides_colored = "(homedecor_generic_wood_plain.png^[transformR90)^homedecor_kitchen_cabinet_bevel.png" diff --git a/mods/decor/homedecor_laundry/init.lua b/mods/decor/homedecor_laundry/init.lua index 084bce111..96508220b 100644 --- a/mods/decor/homedecor_laundry/init.lua +++ b/mods/decor/homedecor_laundry/init.lua @@ -80,8 +80,7 @@ local ib_cbox = { fixed = { -6/16, -8/16, -4/16, 17/16, 4/16, 4/16 } } -local wool_tex = "wool_grey.png" -if not minetest.get_modpath("wool") then wool_tex = "[combine:16x16^[noalpha^[colorize:#3A3B3C" end +local wool_tex = homedecor.textures.wool.grey homedecor.register("ironing_board", { description = S("Ironing board"), diff --git a/mods/decor/homedecor_lighting/init.lua b/mods/decor/homedecor_lighting/init.lua index 03eca8a94..4e52d2ce2 100644 --- a/mods/decor/homedecor_lighting/init.lua +++ b/mods/decor/homedecor_lighting/init.lua @@ -276,6 +276,7 @@ for brightness_level = 0, 14 do }, node_box = glowlight_nodebox.half, groups = { snappy = 3, ud_param2_colorable = 1, not_in_creative_inventory = nici, dig_glass=1, axey=5 }, + is_ground_content = false, _mcl_hardness=1.6, light_source = brightness_level, _sound_def = { @@ -345,6 +346,7 @@ for brightness_level = 0, 14 do }, node_box = glowlight_nodebox.quarter, groups = { snappy = 3, ud_param2_colorable = 1, not_in_creative_inventory = nici, dig_glass=1, axey=5 }, + is_ground_content = false, _mcl_hardness=1.6, light_source = brightness_level, _sound_def = { @@ -415,6 +417,7 @@ for brightness_level = 0, 14 do }, node_box = glowlight_nodebox.small_cube, groups = { snappy = 3, ud_param2_colorable = 1, not_in_creative_inventory = nici, dig_glass=1, axey=5 }, + is_ground_content = false, _mcl_hardness=1.6, light_source = brightness_level, _sound_def = { @@ -449,7 +452,7 @@ for brightness_level = 0, 14 do lighttex = "homedecor_plasma_lamp_off.png" end - local gtex=minetest.get_modpath("default") and "default_gold_block.png" or "[combine:16x16^[noalpha^[colorize:#FFD700" + local gtex=homedecor.textures.metal.gold.block homedecor.register("plasma_lamp_"..brightness_level, { description = S("Plasma Lamp/Light"), drawtype = "mesh", @@ -700,8 +703,7 @@ for brightness_level = 0, 14 do fixed = { -0.25, -0.5, -0.25, 0.25, 1.5, 0.25 } } - local wool_brightened=(minetest.get_modpath("wool") and "wool_grey.png" or "[combine:16x16^[noalpha6[colorize:#A9A9A9") - .. "^[colorize:#ffffff:"..(brightness_level * 15) + local wool_brightened=homedecor.textures.wool.grey .. "^[colorize:#ffffff:"..(brightness_level * 15) homedecor.register("table_lamp_"..brightness_level, { description = S("Table Lamp/Light"), @@ -793,7 +795,7 @@ for _, light_brightn_name in ipairs({"off", "on"}) do local gen_ls_tex_yellow = "homedecor_generic_light_source_off.png" if onflag then gen_ls_tex_yellow = "homedecor_generic_light_source_yellow.png" end - local lighttex = "homedecor_blanktile.png" + local lighttex = "blank.png" if onflag then lighttex = { name = "homedecor_plasma_ball_streamers.png", @@ -869,6 +871,7 @@ for _, light_brightn_name in ipairs({"off", "on"}) do "group:mesecon_conductor_craftable" }, groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory = nici_m, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, _sound_def = { key = "node_sound_stone_defaults", @@ -918,6 +921,7 @@ for _, light_brightn_name in ipairs({"off", "on"}) do "group:mesecon_conductor_craftable" }, groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory = nici_m, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, _sound_def = { key = "node_sound_stone_defaults", @@ -1133,6 +1137,7 @@ minetest.register_node(":homedecor:chain_steel_top", { paramtype = "light", inventory_image = "basic_materials_chain_steel_inv.png", groups = {cracky=3, dig_glass=1, pickaxey=5}, + is_ground_content = false, _mcl_hardness=1.6, selection_box = topchains_sbox, }) @@ -1148,6 +1153,7 @@ minetest.register_node(":homedecor:chain_brass_top", { paramtype = "light", inventory_image = "basic_materials_chain_brass_inv.png", groups = {cracky=3, dig_glass=1, pickaxey=5}, + is_ground_content = false, _mcl_hardness=1.6, selection_box = topchains_sbox, }) @@ -1176,6 +1182,7 @@ minetest.register_node(":homedecor:chandelier_steel", { mesh = "homedecor_chandelier.obj", use_texture_alpha = "clip", groups = {cracky=3, dig_glass=1, pickaxey=5}, + is_ground_content = false, _mcl_hardness=1.6, _sound_def = { key = "node_sound_stone_defaults", @@ -1206,6 +1213,7 @@ minetest.register_node(":homedecor:chandelier_brass", { mesh = "homedecor_chandelier.obj", use_texture_alpha = "clip", groups = {cracky=3, dig_glass=1, pickaxey=5}, + is_ground_content = false, _mcl_hardness=1.6, _sound_def = { key = "node_sound_stone_defaults", diff --git a/mods/decor/homedecor_misc/init.lua b/mods/decor/homedecor_misc/init.lua index ee4092e6d..f16413d83 100644 --- a/mods/decor/homedecor_misc/init.lua +++ b/mods/decor/homedecor_misc/init.lua @@ -11,8 +11,8 @@ local S = minetest.get_translator("homedecor_misc") homedecor_misc = {} -local wool_black, wool_grey = homedecor.textures.wool_black, homedecor.textures.wool_grey -local wood_tex = homedecor.textures.default_wood +local wool_black, wool_grey = homedecor.textures.wool.black, homedecor.textures.wool.grey +local wood_tex = homedecor.textures.wood.apple.planks homedecor.register("ceiling_paint", { description = S("Textured Ceiling Paint"), @@ -637,6 +637,7 @@ minetest.register_node(":homedecor:tatami_mat", { drawtype = "nodebox", paramtype = "light", groups = {snappy=3, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, node_box = { type = "fixed", @@ -1037,6 +1038,7 @@ minetest.register_node(":homedecor:japanese_wall_top", { paramtype = "light", paramtype2 = "facedir", groups = {snappy=3, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, selection_box = jp_cbox, collision_box = jp_cbox, @@ -1056,6 +1058,7 @@ minetest.register_node(":homedecor:japanese_wall_middle", { paramtype = "light", paramtype2 = "facedir", groups = {snappy=3, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, selection_box = jp_cbox, collision_box = jp_cbox, @@ -1075,6 +1078,7 @@ minetest.register_node(":homedecor:japanese_wall_bottom", { paramtype = "light", paramtype2 = "facedir", groups = {snappy=3, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, selection_box = jp_cbox, collision_box = jp_cbox, diff --git a/mods/decor/homedecor_pictures_and_paintings/init.lua b/mods/decor/homedecor_pictures_and_paintings/init.lua index d231cb3f6..39c79c245 100644 --- a/mods/decor/homedecor_pictures_and_paintings/init.lua +++ b/mods/decor/homedecor_pictures_and_paintings/init.lua @@ -1,6 +1,6 @@ local S = minetest.get_translator("homedecor_pictures_and_paintings") -local wood_tex = homedecor.textures.default_wood +local wood_tex = homedecor.textures.wood.apple.planks local pframe_cbox = { type = "fixed", diff --git a/mods/decor/homedecor_roofing/init.lua b/mods/decor/homedecor_roofing/init.lua index 93a5738ef..123f12bda 100644 --- a/mods/decor/homedecor_roofing/init.lua +++ b/mods/decor/homedecor_roofing/init.lua @@ -5,10 +5,11 @@ homedecor_roofing = {} minetest.register_node(":homedecor:skylight", { description = S("Glass Skylight"), drawtype = "raillike", - tiles = { homedecor.textures.glass }, - wield_image = homedecor.textures.glass, + tiles = { homedecor.textures.glass.pane }, + wield_image = homedecor.textures.glass.pane, inventory_image = "homedecor_skylight_inv.png", groups = { snappy = 3, dig_tree = 2 , axey=5}, + is_ground_content = false, _mcl_hardness=1.6, paramtype = "light", _sound_def = { @@ -26,6 +27,7 @@ minetest.register_node(":homedecor:skylight_frosted", { inventory_image = "homedecor_skylight_frosted_inv.png", use_texture_alpha = "blend", groups = { snappy = 3, dig_tree = 2, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, paramtype = "light", _sound_def = { @@ -45,6 +47,7 @@ for s, s_loc in pairs({ ["asphalt"] = S("asphalt"), ["terracotta"] = S("terracot paramtype = "light", walkable = false, groups = { snappy = 3, dig_tree = 2, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, _sound_def = { key = "node_sound_wood_defaults", @@ -104,6 +107,7 @@ homedecor_roofing.register_outer_corner = function(modname, subname, groups, slo selection_box = ocorner_cbox, collision_box = ocorner_cbox, groups = groups, + is_ground_content = false, _mcl_hardness=1.6, on_place = minetest.rotate_node, _sound_def = { @@ -129,6 +133,7 @@ homedecor_roofing.register_inner_corner = function(modname, subname, groups, slo paramtype2 = "facedir", collision_box = icorner_cbox, groups = groups, + is_ground_content = false, _mcl_hardness=1.6, on_place = minetest.rotate_node, _sound_def = { @@ -156,6 +161,7 @@ homedecor_roofing.register_slope = function(modname, subname, recipeitem, groups collision_box = slope_cbox, use_texture_alpha = "blend", groups = groups, + is_ground_content = false, _mcl_hardness=1.6, on_place = minetest.rotate_node, _sound_def = { @@ -330,8 +336,7 @@ homedecor_roofing.register_slope("homedecor", "glass", S("Glass Shingles") ) -local brick_tex = "default_brick.png" -if not minetest.get_modpath("default") then brick_tex = "[combine:16x16^[noalpha^[colorize:#AA4A44" end +local brick_tex = homedecor.textures.brick homedecor.register("chimney", { description = S("Chimney"), diff --git a/mods/decor/homedecor_seating/armchairs.lua b/mods/decor/homedecor_seating/armchairs.lua index af5ab958b..8359c913e 100644 --- a/mods/decor/homedecor_seating/armchairs.lua +++ b/mods/decor/homedecor_seating/armchairs.lua @@ -20,6 +20,7 @@ minetest.register_node(":lrfurn:armchair", { palette = "unifieddyes_palette_colorwallmounted.png", inventory_image = "lrfurn_armchair_inv.png", groups = {snappy=3, ud_param2_colorable = 1, dig_tree=2, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, _sound_def = { key = "node_sound_wood_defaults", @@ -39,9 +40,9 @@ homedecor.register("armchair", { description = S("Armchair"), mesh = "forniture_armchair.obj", tiles = { - homedecor.textures.wool_white, - { name = homedecor.textures.wool_dark_grey, color = 0xffffffff }, - { name = homedecor.textures.default_wood, color = 0xffffffff } + homedecor.textures.wool.white, + { name = homedecor.textures.wool.dark_grey, color = 0xffffffff }, + { name = homedecor.textures.wood.apple.planks, color = 0xffffffff } }, inventory_image = "homedecor_armchair_inv.png", paramtype2 = "colorwallmounted", diff --git a/mods/decor/homedecor_seating/longsofas.lua b/mods/decor/homedecor_seating/longsofas.lua index 35b3f4f86..e919ef921 100644 --- a/mods/decor/homedecor_seating/longsofas.lua +++ b/mods/decor/homedecor_seating/longsofas.lua @@ -19,6 +19,7 @@ minetest.register_node(":lrfurn:longsofa", { inventory_image = "lrfurn_longsofa_inv.png", wield_scale = { x = 0.6, y = 0.6, z = 0.6 }, groups = {snappy=3, ud_param2_colorable = 1, dig_tree=2, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, _sound_def = { key = "node_sound_wood_defaults", diff --git a/mods/decor/homedecor_seating/misc.lua b/mods/decor/homedecor_seating/misc.lua index 41555faf2..b5d9bb64c 100644 --- a/mods/decor/homedecor_seating/misc.lua +++ b/mods/decor/homedecor_seating/misc.lua @@ -162,7 +162,7 @@ homedecor.register("kitchen_chair_padded", { mesh = "homedecor_kitchen_chair.obj", tiles = { homedecor.plain_wood, - homedecor.textures.wool_white, + homedecor.textures.wool.white, }, inventory_image = "homedecor_chair_padded_inv.png", paramtype2 = "colorwallmounted", diff --git a/mods/decor/homedecor_seating/sofas.lua b/mods/decor/homedecor_seating/sofas.lua index b6e50eac0..5ee43f61e 100644 --- a/mods/decor/homedecor_seating/sofas.lua +++ b/mods/decor/homedecor_seating/sofas.lua @@ -19,6 +19,7 @@ minetest.register_node(":lrfurn:sofa", { inventory_image = "lrfurn_sofa_inv.png", wield_scale = { x = 0.6, y = 0.6, z = 0.6 }, groups = {snappy=3, ud_param2_colorable = 1, dig_tree=2, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, _sound_def = { key = "node_sound_wood_defaults", diff --git a/mods/decor/homedecor_tables/coffeetable.lua b/mods/decor/homedecor_tables/coffeetable.lua index 4db76c74d..16af01e87 100644 --- a/mods/decor/homedecor_tables/coffeetable.lua +++ b/mods/decor/homedecor_tables/coffeetable.lua @@ -59,6 +59,7 @@ minetest.register_node(":lrfurn:coffeetable", { paramtype2 = "facedir", use_texture_alpha = "blend", groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, _sound_def = { key = "node_sound_wood_defaults", diff --git a/mods/decor/homedecor_tables/endtable.lua b/mods/decor/homedecor_tables/endtable.lua index 6fcc373c7..e772d4a82 100644 --- a/mods/decor/homedecor_tables/endtable.lua +++ b/mods/decor/homedecor_tables/endtable.lua @@ -17,6 +17,7 @@ minetest.register_node(":lrfurn:endtable", { paramtype2 = "facedir", use_texture_alpha = "blend", groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, _sound_def = { key = "node_sound_wood_defaults", diff --git a/mods/decor/homedecor_tables/misc.lua b/mods/decor/homedecor_tables/misc.lua index 37a080375..1cf745042 100644 --- a/mods/decor/homedecor_tables/misc.lua +++ b/mods/decor/homedecor_tables/misc.lua @@ -74,9 +74,9 @@ for i, mat in ipairs(tabletop_materials) do tiles = { 'homedecor_'..m..'_table_'..shape..'.png', 'homedecor_'..m..'_table_edges.png', - 'homedecor_blanktile.png', - 'homedecor_blanktile.png', - 'homedecor_blanktile.png', + 'blank.png', + 'blank.png', + 'blank.png', }, wield_image = 'homedecor_'..m..'_table_'..shape..'_inv.png', use_texture_alpha = "blend", @@ -111,8 +111,8 @@ for i, mat in ipairs(tabletop_materials) do description = string.format("%s %s table with %s legs", shape, m, leg_mat), mesh = "homedecor_table_"..shape..".obj", tiles = { - 'homedecor_blanktile.png', - 'homedecor_blanktile.png', + 'blank.png', + 'blank.png', 'homedecor_'..m..'_table_'..shape..'.png', 'homedecor_'..m..'_table_edges.png', "homedecor_table_legs_"..leg_mat..".png", diff --git a/mods/decor/homedecor_wardrobe/init.lua b/mods/decor/homedecor_wardrobe/init.lua index 8ecf24132..07be366c2 100644 --- a/mods/decor/homedecor_wardrobe/init.lua +++ b/mods/decor/homedecor_wardrobe/init.lua @@ -94,6 +94,7 @@ local def = { paramtype2 = "facedir", groups = {snappy = 3, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, selection_box = wd_cbox, collision_box = wd_cbox, diff --git a/mods/decor/homedecor_windows_and_treatments/init.lua b/mods/decor/homedecor_windows_and_treatments/init.lua index 04004b221..d65ff5a2f 100644 --- a/mods/decor/homedecor_windows_and_treatments/init.lua +++ b/mods/decor/homedecor_windows_and_treatments/init.lua @@ -161,7 +161,7 @@ homedecor.register("curtain_open", { local mats = { { "brass", S("brass"), "homedecor_generic_metal_brass.png" }, { "wrought_iron", S("wrought iron"), "homedecor_generic_metal_wrought_iron.png" }, - { "wood", S("wood"), homedecor.textures.default_wood } + { "wood", S("wood"), homedecor.textures.wood.apple.planks } } for _, m in ipairs(mats) do diff --git a/mods/decor/lavalamp/init.lua b/mods/decor/lavalamp/init.lua index a377ba3b8..72a3171f6 100644 --- a/mods/decor/lavalamp/init.lua +++ b/mods/decor/lavalamp/init.lua @@ -35,6 +35,7 @@ minetest.register_node("lavalamp:lavalamp", { fixed = { -0.25, -0.5, -0.25, 0.25,0.5, 0.25 }, }, groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, ud_param2_colorable = 1, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, _sound_def = { key = "node_sound_glass_defaults", @@ -66,6 +67,7 @@ minetest.register_node("lavalamp:lavalamp_off", { fixed = { -0.25, -0.5, -0.25, 0.25,0.5, 0.25 }, }, groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, _sound_def = { key = "node_sound_glass_defaults", diff --git a/mods/libs/sound_api/.luacheckrc b/mods/libs/sound_api/.luacheckrc deleted file mode 100644 index 2efe27d63..000000000 --- a/mods/libs/sound_api/.luacheckrc +++ /dev/null @@ -1,3 +0,0 @@ -globals = { - "sound_api", "minetest", -} \ No newline at end of file diff --git a/mods/libs/sound_api/README.md b/mods/libs/sound_api/README.md deleted file mode 100644 index 735572a69..000000000 --- a/mods/libs/sound_api/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Sound API - -mod that enables sound to be game agnostic -## Installing - -* `git clone https://github.com/mt-mods/sound_api.git` -* `cd sound_api` -* `git submodule init` -* `git submodule update` - -to update please use the following commands starting inside the mod directory - -* `git pull` -* `git submodule sync` -* `git submodule update` - -## Dev Docs - -Can be found at /DEV.md \ No newline at end of file diff --git a/mods/libs/sound_api/mod.conf b/mods/libs/sound_api/mod.conf deleted file mode 100644 index 9ae1ebe13..000000000 --- a/mods/libs/sound_api/mod.conf +++ /dev/null @@ -1,2 +0,0 @@ -name = sound_api -optional_depends = default, fl_stone, fl_trees, mcl_sounds, hades_sounds, ks_sounds, nodes_nature, fl_topsoil, fl_trees \ No newline at end of file diff --git a/mods/libs/sound_api/sound_api_core/.luacheckrc b/mods/libs/sound_api/sound_api_core/.luacheckrc deleted file mode 100644 index 0d321917a..000000000 --- a/mods/libs/sound_api/sound_api_core/.luacheckrc +++ /dev/null @@ -1,5 +0,0 @@ -read_globals = { - "minetest", "mcl_sounds", "default", "ks_sounds", - "nodes_nature", "fl_stone", "fl_topsoil", "fl_trees", - "hades_sounds", "rp_sounds", -} \ No newline at end of file diff --git a/mods/libs/sound_api/sound_api_core/LICENSE b/mods/libs/sound_api/sound_api_core/LICENSE deleted file mode 100644 index 50e6e0126..000000000 --- a/mods/libs/sound_api/sound_api_core/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ - -MIT Copyright 2021 wsor4035 - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/mods/libs/sound_api/sound_api_core/init.lua b/mods/libs/sound_api/sound_api_core/init.lua deleted file mode 100644 index 13396c30d..000000000 --- a/mods/libs/sound_api/sound_api_core/init.lua +++ /dev/null @@ -1,297 +0,0 @@ -local sound_api = {} - ---convert some games for api usage - ---ks_sounds conversion ---currently loggy and bedrock are ignored -local ks = {} - -function ks.node_sound_defaults(table) - table = table or {} - table.footstep = table.footstep or ks_sounds.generalnode_sounds.footstep - table.dug = table.dug or ks_sounds.generalnode_sounds.dug - table.dig = table.dig or ks_sounds.generalnode_sounds.dig - table.place = table.place or ks_sounds.generalnode_sounds.place - return table -end - -function ks.node_sound_wood_defaults(table) - table = table or {} - table.footstep = table.footstep or ks_sounds.woodennode_sounds.footstep - table.dug = table.dug or ks_sounds.woodennode_sounds.dug - table.dig = table.dig or ks_sounds.woodennode_sounds.dig - table.place = table.place or ks_sounds.woodennode_sounds.place - ks.node_sound_defaults(table) - return table -end - -function ks.node_sound_leaves_defaults(table) - table = table or {} - table.footstep = table.footstep or ks_sounds.leafynode_sounds.footstep - table.dug = table.dug or ks_sounds.leafynode_sounds.dug - table.dig = table.dig or ks_sounds.leafynode_sounds.dig - table.place = table.place or ks_sounds.leafynode_sounds.place - ks.node_sound_defaults(table) - return table -end - -function ks.node_sound_snow_defaults(table) - table = table or {} - table.footstep = table.footstep or ks_sounds.snowynode_sounds.footstep - table.dug = table.dug or ks_sounds.snowynode_sounds.dug - table.dig = table.dig or ks_sounds.snowynode_sounds.dig - table.place = table.place or ks_sounds.snowynode_sounds.place - ks.node_sound_defaults(table) - return table -end - - ---api -function sound_api.node_sound_default(table) - if minetest.get_modpath("default") then - return default.node_sound_defaults(table) - elseif minetest.get_modpath("mcl_sounds") then - return mcl_sounds.node_sound_defaults(table) - elseif minetest.get_modpath("ks_sounds") then - return ks.node_sound_default(table) - elseif minetest.get_modpath("nodes_nature") then - return nodes_nature.node_sound_default(table) - elseif minetest.get_modpath("hades_sounds") then - return hades_sounds.node_sound_defaults(table) - elseif minetest.get_modpath("rp_sounds") then - return rp_sounds.node_sound_defaults(table) - else - return table - end -end - -function sound_api.node_sound_stone_defaults(table) - if minetest.get_modpath("default") then - return default.node_sound_stone_defaults(table) - elseif minetest.get_modpath("mcl_sounds") then - return mcl_sounds.node_sound_stone_defaults(table) - elseif minetest.get_modpath("nodes_nature") then - return nodes_nature.node_sound_stone_defaults(table) - elseif minetest.get_modpath("fl_stone") then - return fl_stone.sounds.stone(table) - elseif minetest.get_modpath("hades_sounds") then - return hades_sounds.node_sound_stone_defaults(table) - elseif minetest.get_modpath("rp_sounds") then - return rp_sounds.node_sound_stone_defaults(table) - else - return table - end -end - -function sound_api.node_sound_dirt_defaults(table) - if minetest.get_modpath("default") then - return default.node_sound_dirt_defaults(table) - elseif minetest.get_modpath("mcl_sounds") then - return mcl_sounds.node_sound_dirt_defaults(table) - elseif minetest.get_modpath("nodes_nature") then - return nodes_nature.node_sound_dirt_defaults(table) - --s/dirt/grass - elseif minetest.get_modpath("fl_topsoil") then - return fl_topsoil.sounds.grass(table) - elseif minetest.get_modpath("hades_sounds") then - return hades_sounds.node_sound_dirt_defaults(table) - elseif minetest.get_modpath("rp_sounds") then - return rp_sounds.node_sound_dirt_defaults(table) - else - return table - end -end - ---return dirt as some games use dirt vs grass -function sound_api.node_sound_grass_defaults(table) - if minetest.get_modpath("hades_sounds") then - return hades_sounds.node_sound_grass_defaults(table) - else - return sound_api.node_sound_dirt_defaults(table) - end -end - -function sound_api.node_sound_sand_defaults(table) - if minetest.get_modpath("default") then - return default.node_sound_sand_defaults(table) - elseif minetest.get_modpath("mcl_sounds") then - return mcl_sounds.node_sound_sand_defaults(table) - elseif minetest.get_modpath("nodes_nature") then - return nodes_nature.node_sound_sand_defaults(table) - elseif minetest.get_modpath("fl_stone") then - return fl_stone.sounds.sand(table) - elseif minetest.get_modpath("hades_sounds") then - return hades_sounds.node_sound_sand_defaults(table) - elseif minetest.get_modpath("rp_sounds") then - return rp_sounds.node_sound_sand_defaults(table) - else - return table - end -end - -function sound_api.node_sound_gravel_defaults(table) - if minetest.get_modpath("default") then - return default.node_sound_gravel_defaults(table) - --s/gravel/sand - elseif minetest.get_modpath("mcl_sounds") then - return mcl_sounds.node_sound_sand_defaults(table) - elseif minetest.get_modpath("nodes_nature") then - return nodes_nature.node_sound_gravel_defaults(table) - elseif minetest.get_modpath("fl_topsoil") then - return fl_topsoil.sounds.gravel(table) - elseif minetest.get_modpath("hades_sounds") then - return hades_sounds.node_sound_gravel_defaults(table) - else - return table - end -end - -function sound_api.node_sound_wood_defaults(table) - if minetest.get_modpath("default") then - return default.node_sound_wood_defaults(table) - elseif minetest.get_modpath("mcl_sounds") then - return mcl_sounds.node_sound_wood_defaults(table) - elseif minetest.get_modpath("ks_sounds") then - return ks.node_sound_wood_default(table) - elseif minetest.get_modpath("nodes_nature") then - return nodes_nature.node_sound_wood_defaults(table) - elseif minetest.get_modpath("fl_trees") then - return fl_trees.sounds.wood(table) - elseif minetest.get_modpath("hades_sounds") then - return hades_sounds.node_sound_wood_defaults(table) - elseif minetest.get_modpath("rp_sounds") then - return rp_sounds.node_sound_wood_defaults(table) - else - return table - end -end - -function sound_api.node_sound_leaves_defaults(table) - if minetest.get_modpath("default") then - return default.node_sound_leaves_defaults(table) - elseif minetest.get_modpath("mcl_sounds") then - return mcl_sounds.node_sound_leaves_defaults(table) - elseif minetest.get_modpath("ks_sounds") then - return ks.node_sound_leaves_default(table) - elseif minetest.get_modpath("nodes_nature") then - return nodes_nature.node_sound_leaves_defaults(table) - elseif minetest.get_modpath("hades_sounds") then - return hades_sounds.node_sound_leaves_defaults(table) - elseif minetest.get_modpath("rp_sounds") then - return rp_sounds.node_sound_leaves_defaults(table) - else - return table - end -end - -function sound_api.node_sound_glass_defaults(table) - if minetest.get_modpath("default") then - return default.node_sound_glass_defaults(table) - elseif minetest.get_modpath("mcl_sounds") then - return mcl_sounds.node_sound_glass_defaults(table) - elseif minetest.get_modpath("nodes_nature") then - return nodes_nature.node_sound_glass_defaults(table) - elseif minetest.get_modpath("hades_sounds") then - return hades_sounds.node_sound_glass_defaults(table) - elseif minetest.get_modpath("rp_sounds") then - return rp_sounds.node_sound_glass_defaults(table) - else - return table - end -end - - -function sound_api.node_sound_ice_defaults(table) - if minetest.get_modpath("default") then - return default.node_sound_ice_defaults(table) - --s/ice/glass - elseif minetest.get_modpath("mcl_sounds") then - return mcl_sounds.node_sound_glass_defaults(table) - --s/ice/glass - elseif minetest.get_modpath("nodes_nature") then - return nodes_nature.node_sound_glass_defaults(table) - --s/ice/glass - elseif minetest.get_modpath("hades_sounds") then - return hades_sounds.node_sound_glass_defaults(table) - else - return table - end -end - -function sound_api.node_sound_metal_defaults(table) - if minetest.get_modpath("default") then - return default.node_sound_metal_defaults(table) - elseif minetest.get_modpath("mcl_sounds") then - return mcl_sounds.node_sound_metal_defaults(table) - elseif minetest.get_modpath("hades_sounds") then - return hades_sounds.node_sound_metal_defaults(table) - else - return table - end -end - -function sound_api.node_sound_water_defaults(table) - if minetest.get_modpath("default") then - return default.node_sound_water_defaults(table) - elseif minetest.get_modpath("mcl_sounds") then - return mcl_sounds.node_sound_water_defaults(table) - elseif minetest.get_modpath("nodes_nature") then - return nodes_nature.node_sound_water_defaults(table) - elseif minetest.get_modpath("hades_sounds") then - return hades_sounds.node_sound_water_defaults(table) - elseif minetest.get_modpath("rp_sounds") then - return rp_sounds.node_sound_water_defaults(table) - else - return table - end -end - -function sound_api.node_sound_lava_defaults(table) - --s/lava/water - if minetest.get_modpath("default") then - return default.node_sound_water_defaults(table) - elseif minetest.get_modpath("mcl_sounds") then - return mcl_sounds.node_sound_lava_defaults(table) - --s/lava/water - elseif minetest.get_modpath("nodes_nature") then - return nodes_nature.node_sound_water_defaults(table) - elseif minetest.get_modpath("hades_sounds") then - return hades_sounds.node_sound_lava_defaults(table) - --s/lava/water - elseif minetest.get_modpath("rp_sounds") then - return rp_sounds.node_sound_water_defaults(table) - else - return table - end -end - -function sound_api.node_sound_snow_defaults(table) - if minetest.get_modpath("default") then - return default.node_sound_snow_defaults(table) - elseif minetest.get_modpath("mcl_sounds") then - return mcl_sounds.node_sound_snow_defaults(table) - elseif minetest.get_modpath("ks_sounds") then - return ks.node_sound_snow_default(table) - elseif minetest.get_modpath("nodes_nature") then - return nodes_nature.node_sound_snow_defaults(table) - elseif minetest.get_modpath("fl_topsoil") then - return fl_topsoil.sounds.snow(table) - elseif minetest.get_modpath("rp_sounds") then - return rp_sounds.node_sound_snow_defaults(table) - else - return table - end -end - -function sound_api.node_sound_wool_defaults(table) - --s/wool/default - if minetest.get_modpath("default") then - return default.node_sound_defaults(table) - elseif minetest.get_modpath("mcl_sounds") then - return mcl_sounds.node_sound_wool_defaults(table) - else - return table - end -end - -return sound_api \ No newline at end of file diff --git a/mods/libs/xcompat/.luacheckrc b/mods/libs/xcompat/.luacheckrc new file mode 100644 index 000000000..8e8ff9af4 --- /dev/null +++ b/mods/libs/xcompat/.luacheckrc @@ -0,0 +1,17 @@ + +globals = { + "minetest", + "xcompat", +} + +read_globals = { + "default", + "mcl_sounds", + "ks_sounds", + "nodes_nature", + "fl_stone", + "fl_topsoil", + "fl_trees", + "hades_sounds", + "rp_sounds", +} diff --git a/mods/libs/sound_api/DEV.md b/mods/libs/xcompat/DEV.md similarity index 51% rename from mods/libs/sound_api/DEV.md rename to mods/libs/xcompat/DEV.md index 10b3b1979..1fa241241 100644 --- a/mods/libs/sound_api/DEV.md +++ b/mods/libs/xcompat/DEV.md @@ -1,20 +1,8 @@ -# Sound API +# Xcompat dev docs -This mod is a wrapper for [sound api library](https://github.com/mt-mods/sound_api_core/). +## Sound API -## Usage of the sound api - -### Option 1: embed - -You can insert the [sound api library](https://github.com/mt-mods/sound_api_core/) directly into your mod as a submodule and use the following to load it. - -```lua -local sound_api = dofile(modpath .. "/sound_api_core/init.lua") -``` - -additionally the author recommends that you use dependabot(github) or similar to help you keep the submodule up to date. - -### Option 2: Agnostically depend +### Option 1: Agnostically depend You can do this by using a custom field in your node def instead of the `sounds` key. @@ -34,17 +22,20 @@ where: * key: string name of the field from the sound api you want to use, for example `node_sound_stone_defaults` * input: table input of fields you want passed to the key field, used to override specific sounds. -### Option 3: Hard depend +### Option 2: Hard depend add this mod to your mod.confs depends and directly call the sound_api as follows ```lua minetest.register_node(nodename, { ... - sounds = sound_api.node_sound_stone_defaults(input) + sounds = xcompat.sounds.node_sound_stone_defaults(input) ... }) ``` * input: optional table to override some or all of returned values +## Materials API + +consult `/src/materials.lua` at this time \ No newline at end of file diff --git a/mods/libs/sound_api/LICENSE b/mods/libs/xcompat/LICENSE similarity index 96% rename from mods/libs/sound_api/LICENSE rename to mods/libs/xcompat/LICENSE index 50e6e0126..b04a4864c 100644 --- a/mods/libs/sound_api/LICENSE +++ b/mods/libs/xcompat/LICENSE @@ -1,5 +1,5 @@ -MIT Copyright 2021 wsor4035 +MIT Copyright 2021-2024 wsor4035 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/mods/libs/xcompat/README.md b/mods/libs/xcompat/README.md new file mode 100644 index 000000000..724fb6a3e --- /dev/null +++ b/mods/libs/xcompat/README.md @@ -0,0 +1,31 @@ +# XCompat + +[![luacheck](https://github.com/mt-mods/xcompat/workflows/luacheck/badge.svg)](https://github.com/mt-mods/xcompat/actions) +[![ContentDB](https://content.minetest.net/packages/mt-mods/xcompat/shields/downloads/)](https://content.minetest.net/packages/mt-mods/xcompat/) + +Provides cross compatibility between games and mods for sounds and crafting materials. + +Thanks to: +* MisterE, OgelGames, and Blockhead for naming advice/suggestion. +* luk3yx, Blockhead, BuckarooBanzai for bouncing ideas on the concept of this mod. + +## Usage + +See [DEV.md](DEV.md) for detailed documentation. + +## Directly supported games and mods + +| Games | Sounds | Materials | Textures | +| ----------------- | --------- | --------- | --------- | +| Minetest Game | x | x | x | +| MineClone2 | x | x | | +| Mineclonia | x | x | | +| Hades Revisited | x | x | | +| Farlands Reloaded | x | x | x | +| Exile | x | | | +| KSurvive 2 | x | | | + +**Mods** +* `basic_materials` +* `mesecons_materials` +* `moreores` diff --git a/mods/libs/sound_api/init.lua b/mods/libs/xcompat/init.lua similarity index 63% rename from mods/libs/sound_api/init.lua rename to mods/libs/xcompat/init.lua index ec392e29d..bab37d494 100644 --- a/mods/libs/sound_api/init.lua +++ b/mods/libs/xcompat/init.lua @@ -1,9 +1,13 @@ -local modpath = minetest.get_modpath("sound_api") +local modpath = minetest.get_modpath("xcompat") -sound_api = dofile(modpath .. "/sound_api_core/init.lua") +xcompat = { + sounds = dofile(modpath .. "/src/sounds.lua"), + materials = dofile(modpath .. "/src/materials.lua"), + textures = dofile(modpath .. "/src/textures.lua"), +} local function validate_sound(key) - if key and sound_api[key] then + if key and xcompat.sounds[key] then return true elseif key then minetest.log("warning", "attempted to call invalid sound: "..key) @@ -17,7 +21,7 @@ minetest.register_on_mods_loaded(function() for name, def in pairs(minetest.registered_nodes) do if def._sound_def and validate_sound(def._sound_def.key) then minetest.override_item(name, { - sounds = sound_api[def._sound_def.key](def._sound_def.input) + sounds = xcompat.sounds[def._sound_def.key](def._sound_def.input) }) end end @@ -25,7 +29,7 @@ minetest.register_on_mods_loaded(function() local old_reg_node = minetest.register_node function minetest.register_node(name, def) if def._sound_def and validate_sound(def._sound_def.key) then - def.sounds = sound_api[def._sound_def.key](def._sound_def.input) + def.sounds = xcompat.sounds[def._sound_def.key](def._sound_def.input) end old_reg_node(name, def) diff --git a/mods/libs/xcompat/mod.conf b/mods/libs/xcompat/mod.conf new file mode 100644 index 000000000..f7568a64e --- /dev/null +++ b/mods/libs/xcompat/mod.conf @@ -0,0 +1,3 @@ +name = xcompat +description = Provides cross compatibility between mods and games for sounds and crafting materials. +optional_depends = default, fl_stone, fl_trees, mcl_sounds, hades_sounds, ks_sounds, nodes_nature, fl_topsoil, fl_trees, mcl_core diff --git a/mods/decor/homedecor_common/materials.lua b/mods/libs/xcompat/src/materials.lua similarity index 69% rename from mods/decor/homedecor_common/materials.lua rename to mods/libs/xcompat/src/materials.lua index a6b81717f..6bb70bcae 100644 --- a/mods/decor/homedecor_common/materials.lua +++ b/mods/libs/xcompat/src/materials.lua @@ -1,11 +1,20 @@ -homedecor.materials = { +local materials = { dirt = "default:dirt", sand = "default:sand", + sandstone = "default:sandstone", gravel = "default:gravel", copper_ingot = "default:copper_ingot", steel_ingot = "default:steel_ingot", gold_ingot = "default:gold_ingot", tin_ingot = "default:tin_ingot", + copper_block = "default:copperblock", + steel_block = "default:steelblock", + gold_block = "default:goldblock", + tin_block = "default:tinblock", + axe_steel = "default:axe_steel", + pick_steel = "default:pick_steel", + mese = "default:mese", + mese_crystal = "default:mese_crystal", mese_crystal_fragment = "default:mese_crystal_fragment", torch = "default:torch", diamond = "default:diamond", @@ -38,28 +47,55 @@ homedecor.materials = { wool_white = "wool:white", slab_stone = "stairs:slab_stone", slab_wood = "stairs:slab_wood", + glass = "default:glass", glass_block = "default:glass", glass_bottle = "vessels:glass_bottle", coal_lump = "default:coal_lump", stone = "default:stone", + desert_stone = "default:desert_stone", + desert_sand = "default:desert_sand", + chest = "default:chest", cobble = "default:cobble", brick = "default:brick", obsidian_glass = "default:obsidian_glass", } if minetest.get_modpath("moreores") then - homedecor.materials.silver_ingot = "moreores:silver_ingot" + materials.silver_ingot = "moreores:silver_ingot" +end + +if minetest.get_modpath("technic") then + materials.lead_ingot = "technic:lead_ingot" + materials.carbon_steel_ingot = "technic:carbon_steel_ingot" + materials.stainless_steel_ingot = "technic:stainless_steel_ingot" +end + +if minetest.get_modpath("aloz") then + materials.aluminum_ingot = "aloz:aluminum_ingot" +end + +if minetest.get_modpath("techage") then + materials.aluminum_ingot = "techage:aluminum" end if minetest.get_modpath("mcl_core") then - homedecor.materials = { + materials = { dirt = "mcl_core:dirt", sand = "mcl_core:sand", + sandstone = "mcl_core:sandstone", gravel = "mcl_core:gravel", copper_ingot = "mcl_copper:copper_ingot", steel_ingot = "mcl_core:iron_ingot", gold_ingot = "mcl_core:gold_ingot", tin_ingot = "mcl_core:iron_ingot", + copper_block = "mcl_copper:copper_block", + steel_block = "mcl_core:iron_block", + gold_block = "mcl_core:gold_block", + tin_block = "mcl_core:iron_block", + axe_steel = "mcl_core:axe_steel", + pick_steel = "mcl_core:pick_steel", + mese = "mesecons_torch:redstoneblock", + mese_crystal = "mesecons:redstone", mese_crystal_fragment = "mcl_core:iron_ingot", torch = "mcl_torches:torch", diamond = "mcl_core:diamond", @@ -92,20 +128,35 @@ if minetest.get_modpath("mcl_core") then wool_white = "mcl_wool:white", slab_stone = "mcl_stairs:slab_stone", slab_wood = "mcl_stairs:slab_wood", + glass = "mcl_core:glass", glass_block = "mcl_core:glass", glass_bottle = "mcl_core:glass_bottle", coal_lump = "mcl_core:coal", stone = "mcl_core:stone", + desert_stone = "mcl_core:redsandstone", + desert_sand = "mcl_core:sand", + chest = "mcl_chests:chest", cobble = "mcl_core:cobble", brick = "mcl_core:brick", } elseif minetest.get_modpath("fl_ores") and minetest.get_modpath("fl_stone") then - homedecor.materials = { + materials = { dirt = "fl_topsoil:dirt", sand = "fl_stone:sand", + sandstone = "fl_stone:sandstone", gravel = "fl_topsoil:gravel", + copper_ingot = "fl_ores:copper_ingot", steel_ingot = "fl_ores:iron_ingot", gold_ingot = "fl_ores:gold_ingot", + tin_ingot = "fl_ores:tin_ingot", + copper_block = "fl_ores:copper_block", + steel_block = "fl_ores:iron_block", + gold_block = "fl_ores:gold_block", + tin_block = "fl_ores:tin_block", + axe_steel = "fl_tools:steel_pick", + pick_steel = "fl_tools:steel_axe", + mese = "fl_ores:iron_ingot", + mese_crystal = "fl_ores:iron_ingot", mese_crystal_fragment = "fl_ores:iron_ingot", torch = "fl_light_sources:torch", diamond = "fl_ores:diamond", @@ -125,8 +176,6 @@ elseif minetest.get_modpath("fl_ores") and minetest.get_modpath("fl_stone") then dye_dark_green = "fl_dyes:dark_green_dye", dye_orange = "fl_dyes:orange_dye", dye_pink = "fl_dyes:pink_dye", - copper_ingot = "fl_ores:copper_ingot", - tin_ingot = "fl_ores:tin_ingot", silver_ingot = "fl_ores:iron_ingot", silicon = "mesecons_materials:silicon", string = "fl_plantlife:oxeye_daisy", @@ -140,22 +189,35 @@ elseif minetest.get_modpath("fl_ores") and minetest.get_modpath("fl_stone") then wool_white = "", slab_stone = "fl_stone:stone_slab", slab_wood = "fl_trees:apple_plank_slab", + glass = "fl_glass:framed_glass", glass_block = "fl_glass:framed_glass", glass_bottle = "fl_bottles:bottle", coal_lump = "fl_ores:coal_ore", stone = "fl_stone:stone", + desert_stone = "fl_stone:desert_stone", + desert_sand = "fl_stone:desert_sand", + chest = "fl_storage:wood_chest", cobble = "fl_stone:stone_rubble", brick = "", } elseif minetest.get_modpath("hades_core") then - homedecor.materials = { + materials = { sand = "hades_core:fertile_sand", + sandstone = "hades_core:sandstone", gravel = "hades_core:gravel", copper_ingot = "hades_core:copper_ingot", steel_ingot = "hades_core:steel_ingot", gold_ingot = "hades_core:gold_ingot", tin_ingot = "hades_core:tin_ingot", silver_ingot = "--unknown--", + copper_block = "hades_core:copperblock", + steel_block = "hades_core:steelblock", + gold_block = "hades_core:goldblock", + tin_block = "hades_core:tinblock", + axe_steel = "hades_core:axe_steel", + pick_steel = "hades_core:pick_steel", + mese = "hades_core:mese", + mese_crystal = "hades_core:mese_crystal", mese_crystal_fragment = "hades_core:mese_crystal_fragment", torch = "hades_torches:torch", diamond = "hades_core:diamond", @@ -194,20 +256,35 @@ elseif minetest.get_modpath("hades_core") then wool_white = "wool:white", slab_stone = "stairs:slab_stone", slab_wood = "stairs:slab_wood", + glass = "hades_core:glass", glass_block = "hades_core:glass", glass_bottle = "vessels:glass_bottle", obsidian_glass = "hades_core:obsidian_glass", coal_lump = "hades_core:coal_lump", stone = "hades_core:stone", + desert_stone = "hades_core:stone_baked", + desert_sand = "hades_core:volcanic_sand", + chest = "hades_chests:chest"; cobble = "hades_core:cobble", brick = "hades_core:brick" } if minetest.get_modpath("hades_bucket") then - homedecor.materials["water_bucket"] = "hades_bucket:bucket_water" - homedecor.materials["empty_bucket"] = "hades_bucket:bucket_empty" + materials["water_bucket"] = "hades_bucket:bucket_water" + materials["empty_bucket"] = "hades_bucket:bucket_empty" end if minetest.get_modpath("hades_extraores") then - homedecor.materials["silver_ingot"] = "hades_extraores:silver_ingot" + materials["silver_ingot"] = "hades_extraores:silver_ingot" + materials["aluminum_ingot"] = "hades_extraores:aluminum_ingot" end -end \ No newline at end of file + if minetest.get_modpath("hades_default") then + materials.desert_sand = "hades_default:desert_sand" + end + if minetest.get_modpath("hades_technic") then + materials.lead_ingot = "hades_technic:lead_ingot" + materials.carbon_steel_ingot = "hades_technic:carbon_steel_ingot" + materials.stainless_steel_ingot = "hades_technic:stainless_steel_ingot" + end +end + +return materials \ No newline at end of file diff --git a/mods/libs/xcompat/src/sounds.lua b/mods/libs/xcompat/src/sounds.lua new file mode 100644 index 000000000..7c6448713 --- /dev/null +++ b/mods/libs/xcompat/src/sounds.lua @@ -0,0 +1,297 @@ +local sound_api = {} + +--convert some games for api usage + +--ks_sounds conversion +--currently loggy and bedrock are ignored +local ks = {} + +function ks.node_sound_defaults(soundtable) + soundtable = soundtable or {} + soundtable.footstep = soundtable.footstep or ks_sounds.generalnode_sounds.footstep + soundtable.dug = soundtable.dug or ks_sounds.generalnode_sounds.dug + soundtable.dig = soundtable.dig or ks_sounds.generalnode_sounds.dig + soundtable.place = soundtable.place or ks_sounds.generalnode_sounds.place + return soundtable +end + +function ks.node_sound_wood_defaults(soundtable) + soundtable = soundtable or {} + soundtable.footstep = soundtable.footstep or ks_sounds.woodennode_sounds.footstep + soundtable.dug = soundtable.dug or ks_sounds.woodennode_sounds.dug + soundtable.dig = soundtable.dig or ks_sounds.woodennode_sounds.dig + soundtable.place = soundtable.place or ks_sounds.woodennode_sounds.place + ks.node_sound_defaults(soundtable) + return soundtable +end + +function ks.node_sound_leaves_defaults(soundtable) + soundtable = soundtable or {} + soundtable.footstep = soundtable.footstep or ks_sounds.leafynode_sounds.footstep + soundtable.dug = soundtable.dug or ks_sounds.leafynode_sounds.dug + soundtable.dig = soundtable.dig or ks_sounds.leafynode_sounds.dig + soundtable.place = soundtable.place or ks_sounds.leafynode_sounds.place + ks.node_sound_defaults(soundtable) + return soundtable +end + +function ks.node_sound_snow_defaults(soundtable) + soundtable = soundtable or {} + soundtable.footstep = soundtable.footstep or ks_sounds.snowynode_sounds.footstep + soundtable.dug = soundtable.dug or ks_sounds.snowynode_sounds.dug + soundtable.dig = soundtable.dig or ks_sounds.snowynode_sounds.dig + soundtable.place = soundtable.place or ks_sounds.snowynode_sounds.place + ks.node_sound_defaults(soundtable) + return soundtable +end + + +--api +function sound_api.node_sound_default(soundtable) + if minetest.get_modpath("default") then + return default.node_sound_defaults(soundtable) + elseif minetest.get_modpath("mcl_sounds") then + return mcl_sounds.node_sound_defaults(soundtable) + elseif minetest.get_modpath("ks_sounds") then + return ks.node_sound_default(soundtable) + elseif minetest.get_modpath("nodes_nature") then + return nodes_nature.node_sound_default(soundtable) + elseif minetest.get_modpath("hades_sounds") then + return hades_sounds.node_sound_defaults(soundtable) + elseif minetest.get_modpath("rp_sounds") then + return rp_sounds.node_sound_defaults(soundtable) + else + return soundtable + end +end + +function sound_api.node_sound_stone_defaults(soundtable) + if minetest.get_modpath("default") then + return default.node_sound_stone_defaults(soundtable) + elseif minetest.get_modpath("mcl_sounds") then + return mcl_sounds.node_sound_stone_defaults(soundtable) + elseif minetest.get_modpath("nodes_nature") then + return nodes_nature.node_sound_stone_defaults(soundtable) + elseif minetest.get_modpath("fl_stone") then + return fl_stone.sounds.stone(soundtable) + elseif minetest.get_modpath("hades_sounds") then + return hades_sounds.node_sound_stone_defaults(soundtable) + elseif minetest.get_modpath("rp_sounds") then + return rp_sounds.node_sound_stone_defaults(soundtable) + else + return soundtable + end +end + +function sound_api.node_sound_dirt_defaults(soundtable) + if minetest.get_modpath("default") then + return default.node_sound_dirt_defaults(soundtable) + elseif minetest.get_modpath("mcl_sounds") then + return mcl_sounds.node_sound_dirt_defaults(soundtable) + elseif minetest.get_modpath("nodes_nature") then + return nodes_nature.node_sound_dirt_defaults(soundtable) + --s/dirt/grass + elseif minetest.get_modpath("fl_topsoil") then + return fl_topsoil.sounds.grass(soundtable) + elseif minetest.get_modpath("hades_sounds") then + return hades_sounds.node_sound_dirt_defaults(soundtable) + elseif minetest.get_modpath("rp_sounds") then + return rp_sounds.node_sound_dirt_defaults(soundtable) + else + return soundtable + end +end + +--return dirt as some games use dirt vs grass +function sound_api.node_sound_grass_defaults(soundtable) + if minetest.get_modpath("hades_sounds") then + return hades_sounds.node_sound_grass_defaults(soundtable) + else + return sound_api.node_sound_dirt_defaults(soundtable) + end +end + +function sound_api.node_sound_sand_defaults(soundtable) + if minetest.get_modpath("default") then + return default.node_sound_sand_defaults(soundtable) + elseif minetest.get_modpath("mcl_sounds") then + return mcl_sounds.node_sound_sand_defaults(soundtable) + elseif minetest.get_modpath("nodes_nature") then + return nodes_nature.node_sound_sand_defaults(soundtable) + elseif minetest.get_modpath("fl_stone") then + return fl_stone.sounds.sand(soundtable) + elseif minetest.get_modpath("hades_sounds") then + return hades_sounds.node_sound_sand_defaults(soundtable) + elseif minetest.get_modpath("rp_sounds") then + return rp_sounds.node_sound_sand_defaults(soundtable) + else + return soundtable + end +end + +function sound_api.node_sound_gravel_defaults(soundtable) + if minetest.get_modpath("default") then + return default.node_sound_gravel_defaults(soundtable) + --s/gravel/sand + elseif minetest.get_modpath("mcl_sounds") then + return mcl_sounds.node_sound_sand_defaults(soundtable) + elseif minetest.get_modpath("nodes_nature") then + return nodes_nature.node_sound_gravel_defaults(soundtable) + elseif minetest.get_modpath("fl_topsoil") then + return fl_topsoil.sounds.gravel(soundtable) + elseif minetest.get_modpath("hades_sounds") then + return hades_sounds.node_sound_gravel_defaults(soundtable) + else + return soundtable + end +end + +function sound_api.node_sound_wood_defaults(soundtable) + if minetest.get_modpath("default") then + return default.node_sound_wood_defaults(soundtable) + elseif minetest.get_modpath("mcl_sounds") then + return mcl_sounds.node_sound_wood_defaults(soundtable) + elseif minetest.get_modpath("ks_sounds") then + return ks.node_sound_wood_default(soundtable) + elseif minetest.get_modpath("nodes_nature") then + return nodes_nature.node_sound_wood_defaults(soundtable) + elseif minetest.get_modpath("fl_trees") then + return fl_trees.sounds.wood(soundtable) + elseif minetest.get_modpath("hades_sounds") then + return hades_sounds.node_sound_wood_defaults(soundtable) + elseif minetest.get_modpath("rp_sounds") then + return rp_sounds.node_sound_wood_defaults(soundtable) + else + return soundtable + end +end + +function sound_api.node_sound_leaves_defaults(soundtable) + if minetest.get_modpath("default") then + return default.node_sound_leaves_defaults(soundtable) + elseif minetest.get_modpath("mcl_sounds") then + return mcl_sounds.node_sound_leaves_defaults(soundtable) + elseif minetest.get_modpath("ks_sounds") then + return ks.node_sound_leaves_default(soundtable) + elseif minetest.get_modpath("nodes_nature") then + return nodes_nature.node_sound_leaves_defaults(soundtable) + elseif minetest.get_modpath("hades_sounds") then + return hades_sounds.node_sound_leaves_defaults(soundtable) + elseif minetest.get_modpath("rp_sounds") then + return rp_sounds.node_sound_leaves_defaults(soundtable) + else + return soundtable + end +end + +function sound_api.node_sound_glass_defaults(soundtable) + if minetest.get_modpath("default") then + return default.node_sound_glass_defaults(soundtable) + elseif minetest.get_modpath("mcl_sounds") then + return mcl_sounds.node_sound_glass_defaults(soundtable) + elseif minetest.get_modpath("nodes_nature") then + return nodes_nature.node_sound_glass_defaults(soundtable) + elseif minetest.get_modpath("hades_sounds") then + return hades_sounds.node_sound_glass_defaults(soundtable) + elseif minetest.get_modpath("rp_sounds") then + return rp_sounds.node_sound_glass_defaults(soundtable) + else + return soundtable + end +end + + +function sound_api.node_sound_ice_defaults(soundtable) + if minetest.get_modpath("default") then + return default.node_sound_ice_defaults(soundtable) + --s/ice/glass + elseif minetest.get_modpath("mcl_sounds") then + return mcl_sounds.node_sound_glass_defaults(soundtable) + --s/ice/glass + elseif minetest.get_modpath("nodes_nature") then + return nodes_nature.node_sound_glass_defaults(soundtable) + --s/ice/glass + elseif minetest.get_modpath("hades_sounds") then + return hades_sounds.node_sound_glass_defaults(soundtable) + else + return soundtable + end +end + +function sound_api.node_sound_metal_defaults(soundtable) + if minetest.get_modpath("default") then + return default.node_sound_metal_defaults(soundtable) + elseif minetest.get_modpath("mcl_sounds") then + return mcl_sounds.node_sound_metal_defaults(soundtable) + elseif minetest.get_modpath("hades_sounds") then + return hades_sounds.node_sound_metal_defaults(soundtable) + else + return soundtable + end +end + +function sound_api.node_sound_water_defaults(soundtable) + if minetest.get_modpath("default") then + return default.node_sound_water_defaults(soundtable) + elseif minetest.get_modpath("mcl_sounds") then + return mcl_sounds.node_sound_water_defaults(soundtable) + elseif minetest.get_modpath("nodes_nature") then + return nodes_nature.node_sound_water_defaults(soundtable) + elseif minetest.get_modpath("hades_sounds") then + return hades_sounds.node_sound_water_defaults(soundtable) + elseif minetest.get_modpath("rp_sounds") then + return rp_sounds.node_sound_water_defaults(soundtable) + else + return soundtable + end +end + +function sound_api.node_sound_lava_defaults(soundtable) + --s/lava/water + if minetest.get_modpath("default") then + return default.node_sound_water_defaults(soundtable) + elseif minetest.get_modpath("mcl_sounds") then + return mcl_sounds.node_sound_lava_defaults(soundtable) + --s/lava/water + elseif minetest.get_modpath("nodes_nature") then + return nodes_nature.node_sound_water_defaults(soundtable) + elseif minetest.get_modpath("hades_sounds") then + return hades_sounds.node_sound_lava_defaults(soundtable) + --s/lava/water + elseif minetest.get_modpath("rp_sounds") then + return rp_sounds.node_sound_water_defaults(soundtable) + else + return soundtable + end +end + +function sound_api.node_sound_snow_defaults(soundtable) + if minetest.get_modpath("default") then + return default.node_sound_snow_defaults(soundtable) + elseif minetest.get_modpath("mcl_sounds") then + return mcl_sounds.node_sound_snow_defaults(soundtable) + elseif minetest.get_modpath("ks_sounds") then + return ks.node_sound_snow_default(soundtable) + elseif minetest.get_modpath("nodes_nature") then + return nodes_nature.node_sound_snow_defaults(soundtable) + elseif minetest.get_modpath("fl_topsoil") then + return fl_topsoil.sounds.snow(soundtable) + elseif minetest.get_modpath("rp_sounds") then + return rp_sounds.node_sound_snow_defaults(soundtable) + else + return soundtable + end +end + +function sound_api.node_sound_wool_defaults(soundtable) + --s/wool/default + if minetest.get_modpath("default") then + return default.node_sound_defaults(soundtable) + elseif minetest.get_modpath("mcl_sounds") then + return mcl_sounds.node_sound_wool_defaults(soundtable) + else + return soundtable + end +end + +return sound_api \ No newline at end of file diff --git a/mods/libs/xcompat/src/textures.lua b/mods/libs/xcompat/src/textures.lua new file mode 100644 index 000000000..71816d195 --- /dev/null +++ b/mods/libs/xcompat/src/textures.lua @@ -0,0 +1,179 @@ +local textures = { + gravel = "[combine:16x16^[noalpha^[colorize:#3a3b3c", + brick = "[combine:16x16^[noalpha^[colorize:#AA4A44", + + metal = { + steel = { + ore = "[combine:16x16^[noalpha^[colorize:#D3D3D3", + ingot = "[combine:16x16^[noalpha^[colorize:#D3D3D3", + block = "[combine:16x16^[noalpha^[colorize:#D3D3D3", + }, + gold = { + ore = "[combine:16x16^[noalpha^[colorize:#FFD700", + ingot = "[combine:16x16^[noalpha^[colorize:#FFD700", + block = "[combine:16x16^[noalpha^[colorize:#FFD700", + }, + }, + glass = { + pane = "[combine:16x16:" .. + "0,0=\\[combine\\:1x16\\^[noalpha\\^[colorize\\:#ffffff:" .. + "0,0=\\[combine\\:16x1\\^[noalpha\\^[colorize\\:#ffffff:" .. + "0,15=\\[combine\\:16x1\\^[noalpha\\^[colorize\\:#ffffff:" .. + "15,0=\\[combine\\:1x16\\^[noalpha\\^[colorize\\:#ffffff", + detail = "[combine:16x16:" .. + "0,0=\\[combine\\:1x16\\^[noalpha\\^[colorize\\:#ffffff:" .. + "0,0=\\[combine\\:16x1\\^[noalpha\\^[colorize\\:#ffffff:" .. + "0,15=\\[combine\\:16x1\\^[noalpha\\^[colorize\\:#ffffff:" .. + "15,0=\\[combine\\:1x16\\^[noalpha\\^[colorize\\:#ffffff", + }, + wood = { + apple = { + sapling = "[combine:16x16^[noalpha^[colorize:#654321", + planks = "[combine:16x16^[noalpha^[colorize:#654321", + trunk_side = "[combine:16x16^[noalpha^[colorize:#654321", + trunk_top = "[combine:16x16^[noalpha^[colorize:#654321", + leaves = "[combine:16x16^[noalpha^[colorize:#654321", + }, + jungle = { + sapling = "[combine:16x16^[noalpha^[colorize:#563d2d", + planks = "[combine:16x16^[noalpha^[colorize:#563d2d", + trunk_side = "[combine:16x16^[noalpha^[colorize:#563d2d", + trunk_top = "[combine:16x16^[noalpha^[colorize:#563d2d", + leaves = "[combine:16x16^[noalpha^[colorize:#563d2d", + }, + }, + water = { + tile = "[combine:16x16^[noalpha^[colorize:#00008b", + animated = { + source = "[combine:16x16^[noalpha^[colorize:#00008b", + flowing = "[combine:16x16^[noalpha^[colorize:#00008b", + }, + }, + wool = { + white = "[combine:16x16^[noalpha^[colorize:#ffffff", + black = "[combine:16x16^[noalpha^[colorize:#000000", + grey = "[combine:16x16^[noalpha^[colorize:#313b3c", + dark_grey = "[combine:16x16^[noalpha^[colorize:#313b3c", + }, + grass = { + top = "[combine:16x16^[noalpha^[colorize:#006400", + side = "[combine:16x16^[noalpha^[colorize:#006400", + dirt = "[combine:16x16^[noalpha^[colorize:#563d2d", + }, +} + +if minetest.get_modpath("default") then + textures = { + gravel = "default_gravel.png", + brick = "default_brick.png", + + metal = { + steel = { + ore = "default_iron_lump.png", + ingot = "default_steel_ingot.png", + block = "default_steel_block.png", + }, + gold = { + ore = "default_gold_lump.png", + ingot = "default_gold_ingot.png", + block = "default_gold_block.png", + }, + }, + glass = { + pane = "default_glass.png", + detail = "default_glass_detail.png", + }, + wood = { + apple = { + sapling = "default_sapling.png", + planks = "default_wood.png", + trunk_side = "default_tree.png", + trunk_top = "default_tree_top.png", + leaves = "default_leaves.png", + }, + jungle = { + sapling = "default_junglesapling.png", + planks = "default_junglewood.png", + trunk_side = "default_jungletree.png", + trunk_top = "default_jungletree_top.png", + leaves = "default_jungleleaves.png", + }, + }, + water = { + tile = "default_water.png", + animated = { + source = "default_water_source_animated.png", + flowing = "default_water_flowing_animated.png", + }, + }, + wool = { + white = "wool_white.png", + black = "wool_black.png", + grey = "wool_grey.png", + dark_grey = "wool_dark_grey.png", + }, + grass = { + top = "default_grass.png", + side = "default_dirt.png^default_grass_side.png", + dirt = "default_dirt.png", + }, + } +elseif minetest.get_modpath("fl_ores") and minetest.get_modpath("fl_stone") then + textures = { + gravel = "farlands_gravel.png", + brick = "farlands_brick.png", + + metal = { + steel = { + ore = "farlands_iron_ingot.png", + ingot = "farlands_iron_ingot.png", + block = "farlands_iron_block.png", + }, + gold = { + ore = "farlands_gold_ore.png", + ingot = "farlands_gold_ingot.png", + block = "farlands_gold_block.png", + }, + }, + glass = { + pane = "farlands_glass.png", + detail = "farlands_glass_detail.png", + }, + wood = { + apple = { + sapling = "farlands_apple_sapling.png", + planks = "farlands_apple_planks.png", + trunk_side = "farlands_apple_trunk.png", + trunk_top = "farlands_apple_trunk_top.png", + leaves = "farlands_apple_leaves.png", + }, + jungle = { + sapling = "farlands_jungletree_sapling.png", + planks = "farlands_jungletree_planks.png", + trunk_side = "farlands_jungletree_trunk.png", + trunk_top = "farlands_jungletree_trunk_top.png", + leaves = "farlands_jungletree_leaves.png", + }, + }, + water = { + tile = "farlands_water.png", + animated = { + source = "farlands_water_source_animated.png", + flowing = "farlands_water_flowing_animated.png", + }, + }, + wool = { + white = "farlands_wool.png", + black = "farlands_wool.png", + grey = "farlands_wool.png", + dark_grey = "farlands_wool.png", + }, + grass = { + top = "farlands_grass.png", + side = "farlands_dirt.png^farlands_grass_side.png", + dirt = "farlands_dirt.png", + }, + } +end + +return textures \ No newline at end of file