From 280924c02b0982c096b004a1d6784f217222ad4f Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Sun, 25 Feb 2024 12:04:20 -0500 Subject: [PATCH 01/12] add in xcompat for game agnostic handling dry (#63) --- .luacheckrc | 1 + README.md | 5 +- homedecor_common/materials.lua | 214 +-------------------------------- homedecor_common/mod.conf | 2 +- 4 files changed, 4 insertions(+), 218 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 75c3fba5..9480ba23 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -39,4 +39,5 @@ read_globals = { "creative", "doors", "i3", + "xcompat", } \ No newline at end of file diff --git a/README.md b/README.md index 3b0de423..41365782 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,4 @@ required: * [Unifieddyes](https://github.com/mt-mods/unifieddyes) * [Basic Materials](https://github.com/mt-mods/basic_materials) - -optional: - -* [Sound Api](https://github.com/mt-mods/sound_api) - note: needed for sound support +* [xcompat](https://github.com/mt-mods/xcompat) diff --git a/homedecor_common/materials.lua b/homedecor_common/materials.lua index a6b81717..52b5fb43 100644 --- a/homedecor_common/materials.lua +++ b/homedecor_common/materials.lua @@ -1,213 +1 @@ -homedecor.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", - dye_black = "dye:black", - dye_white = "dye:white", - dye_green = "dye:green", - dye_red = "dye:red", - dye_yellow = "dye:yellow", - dye_brown = "dye:brown", - dye_blue = "dye:blue", - dye_violet = "dye:violet", - dye_grey = "dye:grey", - dye_dark_green = "dye:dark_green", - dye_orange = "dye:orange", - dye_pink = "dye:pink", - silicon = "mesecons_materials:silicon", - string = "farming:string", - paper = "default:paper", - book = "default:book", - iron_lump = "default:iron_lump", - wool_grey = "wool:grey", - wool_green = "wool:green", - wool_dark_green = "wool:dark_green", - wool_brown = "wool:brown", - wool_black = "wool:black", - wool_white = "wool:white", - slab_stone = "stairs:slab_stone", - slab_wood = "stairs:slab_wood", - glass_block = "default:glass", - glass_bottle = "vessels:glass_bottle", - coal_lump = "default:coal_lump", - stone = "default:stone", - cobble = "default:cobble", - brick = "default:brick", - obsidian_glass = "default:obsidian_glass", -} - -if minetest.get_modpath("moreores") then - homedecor.materials.silver_ingot = "moreores:silver_ingot" -end - -if minetest.get_modpath("mcl_core") then - homedecor.materials = { - dirt = "mcl_core:dirt", - sand = "mcl_core:sand", - 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", - mese_crystal_fragment = "mcl_core:iron_ingot", - torch = "mcl_torches:torch", - diamond = "mcl_core:diamond", - clay_lump = "default:clay_lump", - water_bucket = "mcl_buckets:bucket:bucket_water", - empty_bucket = "mcl_buckets:bucket_empty", - dye_dark_grey = "mcl_dyes:dark_grey", - dye_black = "mcl_dyes:black", - dye_white = "mcl_dyes:white", - dye_green = "mcl_dyes:green", - dye_red = "mcl_dyes:red", - dye_yellow = "mcl_dyes:yellow", - dye_brown = "mcl_dyes:brown", - dye_blue = "mcl_dyes:blue", - dye_violet = "mcl_dyes:violet", - dye_grey = "mcl_dyes:grey", - dye_dark_green = "mcl_dyes:dark_green", - dye_orange = "mcl_dyes:orange", - dye_pink = "mcl_dyes:pink", - silicon = "mcl_core:iron_ingot", - string = "mcl_mobitems:string", - paper = "mcl_core:paper", - book = "mcl_core:book", - iron_lump = "mcl_core:stone_with_iron", - wool_grey = "mcl_wool:grey", - wool_green = "mcl_wool:green", - wool_dark_green = "mcl_wool:dark_green", - wool_brown = "mcl_wool:brown", - wool_black = "mcl_wool:black", - wool_white = "mcl_wool:white", - slab_stone = "mcl_stairs:slab_stone", - slab_wood = "mcl_stairs:slab_wood", - glass_block = "mcl_core:glass", - glass_bottle = "mcl_core:glass_bottle", - coal_lump = "mcl_core:coal", - stone = "mcl_core:stone", - cobble = "mcl_core:cobble", - brick = "mcl_core:brick", - } -elseif minetest.get_modpath("fl_ores") and minetest.get_modpath("fl_stone") then - homedecor.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", - dye_black = "fl_dyes:black_dye", - dye_white = "fl_dyes:white_dye", - dye_green = "fl_dyes:green_dye", - dye_red = "fl_dyes:red_dye", - dye_yellow = "fl_dyes:yellow_dye", - dye_brown = "fl_dyes:brown_dye", - dye_blue = "fl_dyes:blue_dye", - dye_violet = "fl_dyes:violet_dye", - dye_grey = "fl_dyes:grey_dye", - 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", - paper = "basic_materials:plastic_sheet", - iron_lump = "fl_ores:iron_ore", - wool_grey = "", - wool_green = "", - wool_dark_green = "", - wool_brown = "", - wool_black = "", - wool_white = "", - slab_stone = "fl_stone:stone_slab", - slab_wood = "fl_trees:apple_plank_slab", - glass_block = "fl_glass:framed_glass", - glass_bottle = "fl_bottles:bottle", - coal_lump = "fl_ores:coal_ore", - stone = "fl_stone:stone", - cobble = "fl_stone:stone_rubble", - brick = "", - } -elseif minetest.get_modpath("hades_core") then - homedecor.materials = { - sand = "hades_core:fertile_sand", - 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--", - mese_crystal_fragment = "hades_core:mese_crystal_fragment", - torch = "hades_torches:torch", - diamond = "hades_core:diamond", - clay_lump = "hades_core:clay_lump", - clay_brick = "hades_core:clay_brick", - - --[[ - 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", - dye_dark_grey = "dye:dark_grey", - dye_black = "dye:black", - dye_white = "dye:white", - dye_green = "dye:green", - dye_red = "dye:red", - dye_yellow = "dye:yellow", - dye_brown = "dye:brown", - dye_blue = "dye:blue", - dye_violet = "dye:violet", - dye_grey = "dye:grey", - dye_dark_green = "dye:dark_green", - dye_orange = "dye:orange", - dye_pink = "dye:pink", - silicon = "hades_materials:silicon", - string = "hades_farming:string", - paper = "hades_core:paper", - book = "hades_core:book", - iron_lump = "hades_core:iron_lump", - wool_grey = "wool:grey", - wool_green = "wool:green", - wool_dark_green = "wool:dark_green", - wool_brown = "wool:brown", - wool_black = "wool:black", - wool_white = "wool:white", - slab_stone = "stairs:slab_stone", - slab_wood = "stairs:slab_wood", - 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", - 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" - end - if minetest.get_modpath("hades_extraores") then - homedecor.materials["silver_ingot"] = "hades_extraores:silver_ingot" - end -end \ No newline at end of file +homedecor.materials = xcompat.materials \ No newline at end of file diff --git a/homedecor_common/mod.conf b/homedecor_common/mod.conf index 321d86a9..7a8bec85 100644 --- a/homedecor_common/mod.conf +++ b/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 From 080551e64713b47f6bb5c94e2504489fb68aa5c7 Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Fri, 1 Mar 2024 00:49:24 +0100 Subject: [PATCH 02/12] Is ground content (#64) see https://github.com/pandorabox-io/pandorabox.io/issues/836 --- building_blocks/node_stairs.lua | 32 ++++++++++++++++-------------- fake_fire/init.lua | 4 ++++ homedecor_common/registration.lua | 2 ++ homedecor_doors_and_gates/init.lua | 3 ++- homedecor_lighting/init.lua | 9 +++++++++ homedecor_misc/init.lua | 4 ++++ homedecor_roofing/init.lua | 6 ++++++ homedecor_seating/armchairs.lua | 1 + homedecor_seating/longsofas.lua | 1 + homedecor_seating/sofas.lua | 1 + homedecor_tables/coffeetable.lua | 1 + homedecor_tables/endtable.lua | 1 + homedecor_wardrobe/init.lua | 1 + itemframes/init.lua | 2 ++ lavalamp/init.lua | 2 ++ 15 files changed, 54 insertions(+), 16 deletions(-) diff --git a/building_blocks/node_stairs.lua b/building_blocks/node_stairs.lua index 8304632e..d45e21a8 100644 --- a/building_blocks/node_stairs.lua +++ b/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,7 +70,7 @@ 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", @@ -81,7 +83,7 @@ end 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 +91,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 +100,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 +110,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 +119,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,7 +141,7 @@ 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 }) @@ -162,7 +164,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 +186,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 +206,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 +230,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 +247,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/fake_fire/init.lua b/fake_fire/init.lua index 39e15f56..20a26e87 100644 --- a/fake_fire/init.lua +++ b/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, @@ -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/homedecor_common/registration.lua b/homedecor_common/registration.lua index 16abc545..cb2b13cd 100644 --- a/homedecor_common/registration.lua +++ b/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/homedecor_doors_and_gates/init.lua b/homedecor_doors_and_gates/init.lua index 4d646c42..b18d7837 100644 --- a/homedecor_doors_and_gates/init.lua +++ b/homedecor_doors_and_gates/init.lua @@ -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/homedecor_lighting/init.lua b/homedecor_lighting/init.lua index 03eca8a9..f3e4073a 100644 --- a/homedecor_lighting/init.lua +++ b/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 = { @@ -869,6 +872,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 +922,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 +1138,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 +1154,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 +1183,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 +1214,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/homedecor_misc/init.lua b/homedecor_misc/init.lua index ee4092e6..eef97490 100644 --- a/homedecor_misc/init.lua +++ b/homedecor_misc/init.lua @@ -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/homedecor_roofing/init.lua b/homedecor_roofing/init.lua index 93a5738e..64f76383 100644 --- a/homedecor_roofing/init.lua +++ b/homedecor_roofing/init.lua @@ -9,6 +9,7 @@ minetest.register_node(":homedecor:skylight", { wield_image = homedecor.textures.glass, 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 = { diff --git a/homedecor_seating/armchairs.lua b/homedecor_seating/armchairs.lua index af5ab958..22c1c107 100644 --- a/homedecor_seating/armchairs.lua +++ b/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", diff --git a/homedecor_seating/longsofas.lua b/homedecor_seating/longsofas.lua index 35b3f4f8..e919ef92 100644 --- a/homedecor_seating/longsofas.lua +++ b/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/homedecor_seating/sofas.lua b/homedecor_seating/sofas.lua index b6e50eac..5ee43f61 100644 --- a/homedecor_seating/sofas.lua +++ b/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/homedecor_tables/coffeetable.lua b/homedecor_tables/coffeetable.lua index 4db76c74..16af01e8 100644 --- a/homedecor_tables/coffeetable.lua +++ b/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/homedecor_tables/endtable.lua b/homedecor_tables/endtable.lua index 6fcc373c..e772d4a8 100644 --- a/homedecor_tables/endtable.lua +++ b/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/homedecor_wardrobe/init.lua b/homedecor_wardrobe/init.lua index 8ecf2413..07be366c 100644 --- a/homedecor_wardrobe/init.lua +++ b/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/itemframes/init.lua b/itemframes/init.lua index 29152000..3571be5b 100644 --- a/itemframes/init.lua +++ b/itemframes/init.lua @@ -136,6 +136,7 @@ minetest.register_node("itemframes:frame",{ paramtype2 = "facedir", sunlight_propagates = true, groups = {choppy = 2, dig_immediate = 2, axey=5}, + is_ground_content = false, _mcl_hardness=1.6, legacy_wallmounted = true, _sound_def = { @@ -217,6 +218,7 @@ minetest.register_node("itemframes:pedestal",{ tiles = {"itemframes_pedestal.png"}, paramtype = "light", groups = {cracky = 3, dig_stone = 2, pickaxey=5}, + is_ground_content = false, _mcl_hardness=1.6, _sound_def = { key = "node_sound_stone_defaults", diff --git a/lavalamp/init.lua b/lavalamp/init.lua index a377ba3b..72a3171f 100644 --- a/lavalamp/init.lua +++ b/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", From 0d5cab94559d34a075d9607829d9b1b09c383992 Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Sun, 3 Mar 2024 15:52:58 -0500 Subject: [PATCH 03/12] replace hardcoded game agnostic texture support and homedecor.textures to xcompat (#66) * switch existing to xcompat textures * replace the rest of the hard coded texture conversions to use homedecor.textures --- building_blocks/node_stairs.lua | 14 ++++------ fake_fire/init.lua | 2 +- homedecor_bathroom/init.lua | 4 +-- homedecor_bedroom/init.lua | 2 +- homedecor_climate_control/init.lua | 2 +- homedecor_clocks/init.lua | 10 ++----- homedecor_common/init.lua | 3 +- homedecor_common/materials.lua | 1 - homedecor_common/textures.lua | 34 ----------------------- homedecor_common/xcompat.lua | 8 ++++++ homedecor_exterior/init.lua | 5 ++-- homedecor_furniture/init.lua | 2 +- homedecor_kitchen/init.lua | 2 +- homedecor_laundry/init.lua | 3 +- homedecor_lighting/init.lua | 5 ++-- homedecor_misc/init.lua | 4 +-- homedecor_pictures_and_paintings/init.lua | 2 +- homedecor_roofing/init.lua | 7 ++--- homedecor_seating/armchairs.lua | 6 ++-- homedecor_seating/misc.lua | 2 +- homedecor_windows_and_treatments/init.lua | 2 +- 21 files changed, 40 insertions(+), 80 deletions(-) delete mode 100644 homedecor_common/materials.lua delete mode 100644 homedecor_common/textures.lua create mode 100644 homedecor_common/xcompat.lua diff --git a/building_blocks/node_stairs.lua b/building_blocks/node_stairs.lua index d45e21a8..349c4bcb 100644 --- a/building_blocks/node_stairs.lua +++ b/building_blocks/node_stairs.lua @@ -76,10 +76,11 @@ building_blocks_stairs("building_blocks:Adobe", { 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"), @@ -147,10 +148,7 @@ minetest.register_node("building_blocks:brobble_spread", { }) 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"), diff --git a/fake_fire/init.lua b/fake_fire/init.lua index 20a26e87..b718c821 100644 --- a/fake_fire/init.lua +++ b/fake_fire/init.lua @@ -178,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", diff --git a/homedecor_bathroom/init.lua b/homedecor_bathroom/init.lua index c3e7fbb8..cd2e1e5e 100644 --- a/homedecor_bathroom/init.lua +++ b/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/homedecor_bedroom/init.lua b/homedecor_bedroom/init.lua index b8666daa..f0a6cddf 100644 --- a/homedecor_bedroom/init.lua +++ b/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/homedecor_climate_control/init.lua b/homedecor_climate_control/init.lua index 1d23e54b..dbe2a0d0 100644 --- a/homedecor_climate_control/init.lua +++ b/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/homedecor_clocks/init.lua b/homedecor_clocks/init.lua index 79035110..854a4b50 100644 --- a/homedecor_clocks/init.lua +++ b/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/homedecor_common/init.lua b/homedecor_common/init.lua index a579597b..0b219021 100644 --- a/homedecor_common/init.lua +++ b/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/homedecor_common/materials.lua b/homedecor_common/materials.lua deleted file mode 100644 index 52b5fb43..00000000 --- a/homedecor_common/materials.lua +++ /dev/null @@ -1 +0,0 @@ -homedecor.materials = xcompat.materials \ No newline at end of file diff --git a/homedecor_common/textures.lua b/homedecor_common/textures.lua deleted file mode 100644 index 77a88307..00000000 --- a/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/homedecor_common/xcompat.lua b/homedecor_common/xcompat.lua new file mode 100644 index 00000000..1efe2ba5 --- /dev/null +++ b/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/homedecor_exterior/init.lua b/homedecor_exterior/init.lua index 8a835f7c..7fbc4668 100644 --- a/homedecor_exterior/init.lua +++ b/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/homedecor_furniture/init.lua b/homedecor_furniture/init.lua index c40d6ada..9c7e33af 100644 --- a/homedecor_furniture/init.lua +++ b/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/homedecor_kitchen/init.lua b/homedecor_kitchen/init.lua index f62d69ff..526d8c59 100644 --- a/homedecor_kitchen/init.lua +++ b/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/homedecor_laundry/init.lua b/homedecor_laundry/init.lua index 084bce11..96508220 100644 --- a/homedecor_laundry/init.lua +++ b/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/homedecor_lighting/init.lua b/homedecor_lighting/init.lua index f3e4073a..9fba9c62 100644 --- a/homedecor_lighting/init.lua +++ b/homedecor_lighting/init.lua @@ -452,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", @@ -703,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"), diff --git a/homedecor_misc/init.lua b/homedecor_misc/init.lua index eef97490..f16413d8 100644 --- a/homedecor_misc/init.lua +++ b/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"), diff --git a/homedecor_pictures_and_paintings/init.lua b/homedecor_pictures_and_paintings/init.lua index d231cb3f..39c79c24 100644 --- a/homedecor_pictures_and_paintings/init.lua +++ b/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/homedecor_roofing/init.lua b/homedecor_roofing/init.lua index 64f76383..123f12bd 100644 --- a/homedecor_roofing/init.lua +++ b/homedecor_roofing/init.lua @@ -5,8 +5,8 @@ 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, @@ -336,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/homedecor_seating/armchairs.lua b/homedecor_seating/armchairs.lua index 22c1c107..8359c913 100644 --- a/homedecor_seating/armchairs.lua +++ b/homedecor_seating/armchairs.lua @@ -40,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/homedecor_seating/misc.lua b/homedecor_seating/misc.lua index 41555faf..b5d9bb64 100644 --- a/homedecor_seating/misc.lua +++ b/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/homedecor_windows_and_treatments/init.lua b/homedecor_windows_and_treatments/init.lua index 04004b22..d65ff5a2 100644 --- a/homedecor_windows_and_treatments/init.lua +++ b/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 From 792c23a7fed004766c9d7e5513e32d7a7dea6b28 Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Tue, 2 Apr 2024 06:54:10 -0400 Subject: [PATCH 04/12] handle interact with node check in non mtg games with a fallback (#68) --- homedecor_common/inventory.lua | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/homedecor_common/inventory.lua b/homedecor_common/inventory.lua index 75cfb89d..d25b7fa3 100644 --- a/homedecor_common/inventory.lua +++ b/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) From d400e421cefef866cdec217e4c6c81b1328c8eab Mon Sep 17 00:00:00 2001 From: Niklp Date: Wed, 3 Apr 2024 00:08:49 +0200 Subject: [PATCH 05/12] Replace `homedecor_blanktile.png` w/ engine provided `blank.png` (#69) --- .../textures/homedecor_blanktile.png | Bin 82 -> 0 bytes homedecor_doors_and_gates/init.lua | 8 ++++---- homedecor_fences/init.lua | 16 ++++++++-------- homedecor_lighting/init.lua | 2 +- homedecor_tables/misc.lua | 10 +++++----- 5 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 homedecor_common/textures/homedecor_blanktile.png diff --git a/homedecor_common/textures/homedecor_blanktile.png b/homedecor_common/textures/homedecor_blanktile.png deleted file mode 100644 index dcdefebb129a671b0344b23f8a00de8673461490..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 82 zcmeAS@N?(olHy`uVBq!ia0vp^0wBx?BpA#)4xIr~OeH~n!3+##lh0ZJdEA~Zjv*Dd bk`)Aj90LZ%yk-3MKo*0itDnm{r-UW|SWOUH diff --git a/homedecor_doors_and_gates/init.lua b/homedecor_doors_and_gates/init.lua index b18d7837..9650f2cb 100644 --- a/homedecor_doors_and_gates/init.lua +++ b/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" } diff --git a/homedecor_fences/init.lua b/homedecor_fences/init.lua index 7d2e9489..6389d691 100644 --- a/homedecor_fences/init.lua +++ b/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/homedecor_lighting/init.lua b/homedecor_lighting/init.lua index 9fba9c62..4e52d2ce 100644 --- a/homedecor_lighting/init.lua +++ b/homedecor_lighting/init.lua @@ -795,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", diff --git a/homedecor_tables/misc.lua b/homedecor_tables/misc.lua index 37a08037..1cf74504 100644 --- a/homedecor_tables/misc.lua +++ b/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", From fa3f7f816b18f9aab2df47d05d12d24964817a5e Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Sun, 28 Apr 2024 14:48:03 -0400 Subject: [PATCH 06/12] trash unused function: homedecor.sit (#71) --- homedecor_common/init.lua | 1 - homedecor_common/sit.lua | 34 ---------------------------------- 2 files changed, 35 deletions(-) delete mode 100644 homedecor_common/sit.lua diff --git a/homedecor_common/init.lua b/homedecor_common/init.lua index 0b219021..0a177910 100644 --- a/homedecor_common/init.lua +++ b/homedecor_common/init.lua @@ -61,7 +61,6 @@ dofile(modpath.."/furnaces.lua") dofile(modpath.."/inventory.lua") dofile(modpath.."/registration.lua") dofile(modpath.."/water_particles.lua") -dofile(modpath.."/sit.lua") dofile(modpath.."/crafts.lua") if minetest.settings:get_bool("log_mod") then diff --git a/homedecor_common/sit.lua b/homedecor_common/sit.lua deleted file mode 100644 index fc49177f..00000000 --- a/homedecor_common/sit.lua +++ /dev/null @@ -1,34 +0,0 @@ -function homedecor.sit(pos, node, clicker) - return -- delete it when the engine is stabler for the player's physics ---[[ - local meta = minetest.get_meta(pos) - local param2 = node.param2 - local name = clicker:get_player_name() - - if name == meta:get_string("is_sit") then - meta:set_string("is_sit", "") - pos.y = pos.y-0.5 - clicker:setpos(pos) - clicker:set_eye_offset({x=0,y=0,z=0}, {x=0,y=0,z=0}) - clicker:set_physics_override(1, 1, 1) - default.player_attached[name] = false - default.player_set_animation(clicker, "stand", 30) - else - meta:set_string("is_sit", clicker:get_player_name()) - clicker:set_eye_offset({x=0,y=-7,z=2}, {x=0,y=0,z=0}) - clicker:set_physics_override(0, 0, 0) - clicker:setpos(pos) - default.player_attached[name] = true - default.player_set_animation(clicker, "sit", 30) - if param2 == 0 then - clicker:set_look_yaw(3.15) - elseif param2 == 1 then - clicker:set_look_yaw(7.9) - elseif param2 == 2 then - clicker:set_look_yaw(6.28) - elseif param2 == 3 then - clicker:set_look_yaw(4.75) - else return end - end ---]] -end From d0ab9b82cee0c1c9d092e4f2823bf92f104f781b Mon Sep 17 00:00:00 2001 From: monk <37543743+monk-afk@users.noreply.github.com> Date: Thu, 23 May 2024 19:37:28 -0300 Subject: [PATCH 07/12] reorder registration of aliases to fix missing recipes, also reorder registration of dye recipes to show item craft first before recipe craft (#72) --- homedecor_lighting/init.lua | 206 ++++++++++++++++++------------------ 1 file changed, 101 insertions(+), 105 deletions(-) diff --git a/homedecor_lighting/init.lua b/homedecor_lighting/init.lua index 4e52d2ce..adcc3559 100644 --- a/homedecor_lighting/init.lua +++ b/homedecor_lighting/init.lua @@ -1421,7 +1421,71 @@ minetest.register_lbm({ end }) +-- aliases +minetest.register_alias("chains:chain_top", "homedecor:chain_steel_top") +minetest.register_alias("chains:chain_top_brass", "homedecor:chain_brass_top") + +minetest.register_alias("chains:chandelier", "homedecor:chandelier_steel") +minetest.register_alias("chains:chandelier_steel", "homedecor:chandelier_steel") +minetest.register_alias("chains:chandelier_brass", "homedecor:chandelier_brass") + +minetest.register_alias("homedecor:glowlight_half", "homedecor:glowlight_half_14") +minetest.register_alias("homedecor:glowlight_quarter", "homedecor:glowlight_quarter_14") +minetest.register_alias("homedecor:glowlight_small_cube", "homedecor:glowlight_small_cube_14") +minetest.register_alias("homedecor:plasma_lamp", "homedecor:plasma_lamp_14") +minetest.register_alias("homedecor:ground_lantern", "homedecor:ground_lantern_14") +minetest.register_alias("homedecor:hanging_lantern", "homedecor:hanging_lantern_14") +minetest.register_alias("homedecor:ceiling_lantern", "homedecor:ceiling_lantern_14") +minetest.register_alias("homedecor:lattice_lantern_large", "homedecor:lattice_lantern_large_14") +minetest.register_alias("homedecor:lattice_lantern_small", "homedecor:lattice_lantern_small_14") +minetest.register_alias("homedecor:desk_lamp", "homedecor:desk_lamp_14") +minetest.register_alias("homedecor:ceiling_lamp", "homedecor:ceiling_lamp_14") +minetest.register_alias("homedecor:table_lamp", "homedecor:table_lamp_14") +minetest.register_alias("homedecor:standing_lamp", "homedecor:standing_lamp_14") +minetest.register_alias("3dforniture:table_lamp", "homedecor:table_lamp_14") + +minetest.register_alias("3dforniture:torch_wall", "homedecor:torch_wall") +minetest.register_alias("torch_wall", "homedecor:torch_wall") + +minetest.register_alias("homedecor:plasma_ball", "homedecor:plasma_ball_on") +minetest.register_alias("homedecor:wall_lamp", "homedecor:wall_lamp_on") + +minetest.register_alias("homedecor:rope_light_on_floor_0", "homedecor:rope_light_on_floor_off") +minetest.register_alias("homedecor:rope_light_on_floor_14", "homedecor:rope_light_on_floor_on") + +minetest.register_alias("homedecor:rope_light_on_ceiling_0", "homedecor:rope_light_on_ceiling_off") +minetest.register_alias("homedecor:rope_light_on_ceiling_14", "homedecor:rope_light_on_ceiling_on") + +for name, level in pairs(word_to_bright) do + minetest.register_alias("homedecor:glowlight_half_"..name, "homedecor:glowlight_half_"..level) + minetest.register_alias("homedecor:glowlight_quarter_"..name, "homedecor:glowlight_quarter_"..level) + minetest.register_alias("homedecor:glowlight_small_cube_"..name, "homedecor:glowlight_small_cube_"..level) + minetest.register_alias("homedecor:rope_light_on_floor_"..name, "homedecor:rope_light_on_floor_"..level) + minetest.register_alias("homedecor:rope_light_on_ceiling_"..name, "homedecor:rope_light_on_ceiling_"..level) + minetest.register_alias("homedecor:plasma_lamp_"..name, "homedecor:plasma_lamp_"..level) + minetest.register_alias("homedecor:plasma_ball_"..name, "homedecor:plasma_ball_"..level) + minetest.register_alias("homedecor:ground_lantern_"..name, "homedecor:ground_lantern_"..level) + minetest.register_alias("homedecor:hanging_lantern_"..name, "homedecor:hanging_lantern_"..level) + minetest.register_alias("homedecor:ceiling_lantern_"..name, "homedecor:ceiling_lantern_"..level) + minetest.register_alias("homedecor:lattice_lantern_large_"..name, "homedecor:lattice_lantern_large_"..level) + minetest.register_alias("homedecor:lattice_lantern_small_"..name, "homedecor:lattice_lantern_small_"..level) + minetest.register_alias("homedecor:desk_lamp_"..name, "homedecor:desk_lamp_"..level) + minetest.register_alias("homedecor:ceiling_lamp_"..name, "homedecor:ceiling_lamp_"..level) + minetest.register_alias("homedecor:table_lamp_"..name, "homedecor:table_lamp_"..level) + minetest.register_alias("homedecor:standing_lamp_"..name, "homedecor:standing_lamp_"..level) + minetest.register_alias("3dforniture:table_lamp_"..name, "homedecor:table_lamp_"..level) +end + +if minetest.get_modpath("darkage") then + minetest.register_alias("homedecor:lattice_lantern_large", "darkage:lamp") + for n = 0, 14 do + minetest.register_alias("homedecor:lattice_lantern_large_"..n, "darkage:lamp") + end + for name, level in pairs(word_to_bright) do + minetest.register_alias("homedecor:lattice_lantern_large_"..name, "darkage:lamp") + end +end -- crafting @@ -1595,6 +1659,17 @@ end -- glowlights +unifieddyes.register_color_craft({ + output = "homedecor:glowlight_half", + palette = "wallmounted", + type = "shapeless", + neutral_node = "homedecor:glowlight_half", + recipe = { + "NEUTRAL_NODE", + "MAIN_DYE" + } +}) + minetest.register_craft({ output = "homedecor:glowlight_half 6", recipe = { @@ -1627,10 +1702,10 @@ minetest.register_craft({ }) unifieddyes.register_color_craft({ - output = "homedecor:glowlight_half", + output = "homedecor:glowlight_quarter", palette = "wallmounted", type = "shapeless", - neutral_node = "homedecor:glowlight_half", + neutral_node = "homedecor:glowlight_quarter", recipe = { "NEUTRAL_NODE", "MAIN_DYE" @@ -1645,10 +1720,10 @@ minetest.register_craft({ }) unifieddyes.register_color_craft({ - output = "homedecor:glowlight_quarter", + output = "homedecor:glowlight_small_cube", palette = "wallmounted", type = "shapeless", - neutral_node = "homedecor:glowlight_quarter", + neutral_node = "homedecor:glowlight_small_cube", recipe = { "NEUTRAL_NODE", "MAIN_DYE" @@ -1679,17 +1754,6 @@ minetest.register_craft({ } }) -unifieddyes.register_color_craft({ - output = "homedecor:glowlight_small_cube", - palette = "wallmounted", - type = "shapeless", - neutral_node = "homedecor:glowlight_small_cube", - recipe = { - "NEUTRAL_NODE", - "MAIN_DYE" - } -}) - ---- minetest.register_craft({ @@ -1710,16 +1774,6 @@ minetest.register_craft({ } }) - -minetest.register_craft({ - output = "homedecor:desk_lamp 2", - recipe = { - { "", "default:steel_ingot", "homedecor:glowlight_small_cube" }, - { "", "basic_materials:steel_strip", "" }, - { "basic_materials:plastic_sheet", "basic_materials:copper_wire", "basic_materials:plastic_sheet" }, - }, -}) - unifieddyes.register_color_craft({ output = "homedecor:desk_lamp", palette = "wallmounted", @@ -1731,6 +1785,15 @@ unifieddyes.register_color_craft({ } }) +minetest.register_craft({ + output = "homedecor:desk_lamp 2", + recipe = { + { "", "default:steel_ingot", "homedecor:glowlight_small_cube" }, + { "", "basic_materials:steel_strip", "" }, + { "basic_materials:plastic_sheet", "basic_materials:copper_wire", "basic_materials:plastic_sheet" }, + }, +}) + minetest.register_craft({ output = "homedecor:hanging_lantern 2", recipe = { @@ -1791,6 +1854,17 @@ minetest.register_craft({ }, }) +unifieddyes.register_color_craft({ + output = "homedecor:standing_lamp_hi", + palette = "extended", + type = "shapeless", + neutral_node = "homedecor:standing_lamp_hi", + recipe = { + "NEUTRAL_NODE", + "MAIN_DYE" + } +}) + minetest.register_craft({ output = "homedecor:standing_lamp_hi", recipe = { @@ -1801,10 +1875,10 @@ minetest.register_craft({ }) unifieddyes.register_color_craft({ - output = "homedecor:standing_lamp_hi", + output = "homedecor:table_lamp_hi", palette = "extended", type = "shapeless", - neutral_node = "homedecor:standing_lamp_hi", + neutral_node = "homedecor:table_lamp_hi", recipe = { "NEUTRAL_NODE", "MAIN_DYE" @@ -1853,18 +1927,6 @@ minetest.register_craft({ }, }) -unifieddyes.register_color_craft({ - output = "homedecor:table_lamp_hi", - palette = "extended", - type = "shapeless", - neutral_node = "homedecor:table_lamp_hi", - recipe = { - "NEUTRAL_NODE", - "MAIN_DYE" - } -}) - - minetest.register_craft({ output = "homedecor:torch_wall 10", recipe = { @@ -1872,69 +1934,3 @@ minetest.register_craft({ { "default:steel_ingot" }, }, }) --- aliases - -minetest.register_alias("chains:chain_top", "homedecor:chain_steel_top") -minetest.register_alias("chains:chain_top_brass", "homedecor:chain_brass_top") - -minetest.register_alias("chains:chandelier", "homedecor:chandelier_steel") -minetest.register_alias("chains:chandelier_steel", "homedecor:chandelier_steel") -minetest.register_alias("chains:chandelier_brass", "homedecor:chandelier_brass") - -minetest.register_alias("homedecor:glowlight_half", "homedecor:glowlight_half_14") -minetest.register_alias("homedecor:glowlight_quarter", "homedecor:glowlight_quarter_14") -minetest.register_alias("homedecor:glowlight_small_cube", "homedecor:glowlight_small_cube_14") -minetest.register_alias("homedecor:plasma_lamp", "homedecor:plasma_lamp_14") -minetest.register_alias("homedecor:ground_lantern", "homedecor:ground_lantern_14") -minetest.register_alias("homedecor:hanging_lantern", "homedecor:hanging_lantern_14") -minetest.register_alias("homedecor:ceiling_lantern", "homedecor:ceiling_lantern_14") -minetest.register_alias("homedecor:lattice_lantern_large", "homedecor:lattice_lantern_large_14") -minetest.register_alias("homedecor:lattice_lantern_small", "homedecor:lattice_lantern_small_14") -minetest.register_alias("homedecor:desk_lamp", "homedecor:desk_lamp_14") -minetest.register_alias("homedecor:ceiling_lamp", "homedecor:ceiling_lamp_14") -minetest.register_alias("homedecor:table_lamp", "homedecor:table_lamp_14") -minetest.register_alias("homedecor:standing_lamp", "homedecor:standing_lamp_14") -minetest.register_alias("3dforniture:table_lamp", "homedecor:table_lamp_14") - -minetest.register_alias("3dforniture:torch_wall", "homedecor:torch_wall") -minetest.register_alias("torch_wall", "homedecor:torch_wall") - -minetest.register_alias("homedecor:plasma_ball", "homedecor:plasma_ball_on") -minetest.register_alias("homedecor:wall_lamp", "homedecor:wall_lamp_on") - -minetest.register_alias("homedecor:rope_light_on_floor_0", "homedecor:rope_light_on_floor_off") -minetest.register_alias("homedecor:rope_light_on_floor_14", "homedecor:rope_light_on_floor_on") - -minetest.register_alias("homedecor:rope_light_on_ceiling_0", "homedecor:rope_light_on_ceiling_off") -minetest.register_alias("homedecor:rope_light_on_ceiling_14", "homedecor:rope_light_on_ceiling_on") - -for name, level in pairs(word_to_bright) do - minetest.register_alias("homedecor:glowlight_half_"..name, "homedecor:glowlight_half_"..level) - minetest.register_alias("homedecor:glowlight_quarter_"..name, "homedecor:glowlight_quarter_"..level) - minetest.register_alias("homedecor:glowlight_small_cube_"..name, "homedecor:glowlight_small_cube_"..level) - minetest.register_alias("homedecor:rope_light_on_floor_"..name, "homedecor:rope_light_on_floor_"..level) - minetest.register_alias("homedecor:rope_light_on_ceiling_"..name, "homedecor:rope_light_on_ceiling_"..level) - minetest.register_alias("homedecor:plasma_lamp_"..name, "homedecor:plasma_lamp_"..level) - minetest.register_alias("homedecor:plasma_ball_"..name, "homedecor:plasma_ball_"..level) - minetest.register_alias("homedecor:ground_lantern_"..name, "homedecor:ground_lantern_"..level) - minetest.register_alias("homedecor:hanging_lantern_"..name, "homedecor:hanging_lantern_"..level) - minetest.register_alias("homedecor:ceiling_lantern_"..name, "homedecor:ceiling_lantern_"..level) - minetest.register_alias("homedecor:lattice_lantern_large_"..name, "homedecor:lattice_lantern_large_"..level) - minetest.register_alias("homedecor:lattice_lantern_small_"..name, "homedecor:lattice_lantern_small_"..level) - minetest.register_alias("homedecor:desk_lamp_"..name, "homedecor:desk_lamp_"..level) - minetest.register_alias("homedecor:ceiling_lamp_"..name, "homedecor:ceiling_lamp_"..level) - minetest.register_alias("homedecor:table_lamp_"..name, "homedecor:table_lamp_"..level) - minetest.register_alias("homedecor:standing_lamp_"..name, "homedecor:standing_lamp_"..level) - minetest.register_alias("3dforniture:table_lamp_"..name, "homedecor:table_lamp_"..level) -end - -if minetest.get_modpath("darkage") then - minetest.register_alias("homedecor:lattice_lantern_large", "darkage:lamp") - for n = 0, 14 do - minetest.register_alias("homedecor:lattice_lantern_large_"..n, "darkage:lamp") - end - for name, level in pairs(word_to_bright) do - minetest.register_alias("homedecor:lattice_lantern_large_"..name, "darkage:lamp") - end -end - From 1ef4837abed38a7abedf5f8144773454a44e2548 Mon Sep 17 00:00:00 2001 From: Niklp Date: Wed, 3 Jul 2024 08:09:31 +0200 Subject: [PATCH 08/12] Use `initial_properties` for entities (#74) --- homedecor_climate_control/init.lua | 12 +++++++----- itemframes/init.lua | 14 ++++++++------ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/homedecor_climate_control/init.lua b/homedecor_climate_control/init.lua index dbe2a0d0..9b1e70ad 100644 --- a/homedecor_climate_control/init.lua +++ b/homedecor_climate_control/init.lua @@ -36,11 +36,13 @@ homedecor.register("air_conditioner", { -- fans minetest.register_entity(":homedecor:mesh_desk_fan", { - collisionbox = homedecor.nodebox.null, - visual = "mesh", - mesh = "homedecor_desk_fan.b3d", - textures = {"homedecor_desk_fan_uv.png"}, - visual_size = {x=10, y=10}, + initial_properties = { + collisionbox = homedecor.nodebox.null, + visual = "mesh", + mesh = "homedecor_desk_fan.b3d", + textures = {"homedecor_desk_fan_uv.png"}, + visual_size = {x=10, y=10}, + } }) local add_mesh_desk_fan_entity = function(pos) diff --git a/itemframes/init.lua b/itemframes/init.lua index 3571be5b..76fade2a 100644 --- a/itemframes/init.lua +++ b/itemframes/init.lua @@ -4,12 +4,14 @@ local tmp = {} local sd_disallow = minetest.get_modpath("screwdriver") and screwdriver.disallow or nil minetest.register_entity("itemframes:item",{ - hp_max = 1, - visual="wielditem", - visual_size={x = 0.33, y = 0.33}, - collisionbox = {0, 0, 0, 0, 0, 0}, - physical = false, - textures = {"air"}, + initial_properties = { + hp_max = 1, + visual = "wielditem", + visual_size = {x = 0.33, y = 0.33}, + collisionbox = {0, 0, 0, 0, 0, 0}, + physical = false, + textures = {"air"}, + }, on_activate = function(self, staticdata) if tmp.nodename ~= nil and tmp.texture ~= nil then self.nodename = tmp.nodename From 8f796e43af0b2e614395f7a928200f78f5e66f20 Mon Sep 17 00:00:00 2001 From: Niklp Date: Tue, 16 Jul 2024 07:50:36 +0200 Subject: [PATCH 09/12] Replace deprecated `get_metadata()` call (#75) --- homedecor_books/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homedecor_books/init.lua b/homedecor_books/init.lua index de574920..a34cc3b1 100644 --- a/homedecor_books/init.lua +++ b/homedecor_books/init.lua @@ -81,7 +81,7 @@ for _, c in ipairs(bookcolors) do name = "homedecor:book_"..color, param2 = fdir, }) - local text = itemstack:get_metadata() or "" + local text = itemstack:get_meta():get_string("") local meta = minetest.get_meta(pos) local data = minetest.deserialize(text) or {} if type(data) ~= "table" then From b2e5c81e4d61395561116fed197310daac880c69 Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Sun, 8 Sep 2024 19:26:36 -0400 Subject: [PATCH 10/12] switch over to using xcompats function --- homedecor_common/inventory.lua | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/homedecor_common/inventory.lua b/homedecor_common/inventory.lua index d25b7fa3..614e0eef 100644 --- a/homedecor_common/inventory.lua +++ b/homedecor_common/inventory.lua @@ -12,22 +12,7 @@ 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_can_interact_with_node = xcompat.functions.can_interact_with_node local default_inventory_formspecs = { ["4"]="size[8,6]".. From a100d20d4d67faf6f936d5a0ccf69991f79a8c7a Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Mon, 9 Sep 2024 12:11:43 -0400 Subject: [PATCH 11/12] implements https://github.com/mt-mods/homedecor_modpack/issues/31 - show players sitting in seats (#76) * implment https://github.com/mt-mods/homedecor_modpack/issues/31 - show players sitting in seats * improve things --- .luacheckrc | 3 ++- homedecor_seating/init.lua | 24 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 9480ba23..ee964473 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -15,7 +15,8 @@ globals = { "homedecor_doors_and_gates", -- mod-deps - "armor" + "armor", + xcompat = {fields = {"player"}}, } read_globals = { diff --git a/homedecor_seating/init.lua b/homedecor_seating/init.lua index 5639fd6f..11cfc048 100644 --- a/homedecor_seating/init.lua +++ b/homedecor_seating/init.lua @@ -78,10 +78,18 @@ function lrfurn.fix_sofa_rotation_nsew(pos, placer, itemstack, pointed_thing) minetest.swap_node(pos, { name = node.name, param2 = fdir+colorbits }) end +local physics_cache = {} + function lrfurn.sit(pos, node, clicker, itemstack, pointed_thing, seats) if not clicker:is_player() then return itemstack end + + if physics_cache[clicker:get_player_name()] then + lrfurn.stand(clicker) + return itemstack + end + --conversion table for param2 to dir local p2d = { vector.new(0, 0, 0), @@ -120,11 +128,25 @@ function lrfurn.sit(pos, node, clicker, itemstack, pointed_thing, seats) end --seat the player - sit_pos.y = sit_pos.y-0.5 clicker:set_pos(sit_pos) + + xcompat.player.player_attached[clicker:get_player_name()] = true + xcompat.player.set_animation(clicker, "sit", 0) + physics_cache[clicker:get_player_name()] = table.copy(clicker:get_physics_override()) + clicker:set_physics_override({speed = 0, jump = 0, gravity = 0}) + return itemstack end +function lrfurn.stand(clicker) + xcompat.player.player_attached[clicker:get_player_name()] = false + if physics_cache[clicker:get_player_name()] then + clicker:set_physics_override(physics_cache[clicker:get_player_name()]) + else --in case this is called and the cache is empty + clicker:set_physics_override({speed = 1, jump = 1, gravity = 1}) + end +end + dofile(modpath.."/longsofas.lua") dofile(modpath.."/sofas.lua") dofile(modpath.."/armchairs.lua") From 335559feb3946b43a321e3703f19236438959e6d Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Wed, 11 Sep 2024 20:18:38 -0400 Subject: [PATCH 12/12] fix seating only working once till server restarts --- homedecor_seating/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/homedecor_seating/init.lua b/homedecor_seating/init.lua index 11cfc048..cec447f4 100644 --- a/homedecor_seating/init.lua +++ b/homedecor_seating/init.lua @@ -142,6 +142,7 @@ function lrfurn.stand(clicker) xcompat.player.player_attached[clicker:get_player_name()] = false if physics_cache[clicker:get_player_name()] then clicker:set_physics_override(physics_cache[clicker:get_player_name()]) + physics_cache[clicker:get_player_name()] = nil else --in case this is called and the cache is empty clicker:set_physics_override({speed = 1, jump = 1, gravity = 1}) end