diff options
Diffstat (limited to 'homedecor/bathroom_furniture.lua')
-rw-r--r-- | homedecor/bathroom_furniture.lua | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/homedecor/bathroom_furniture.lua b/homedecor/bathroom_furniture.lua index 0e839fd..d7cd0c6 100644 --- a/homedecor/bathroom_furniture.lua +++ b/homedecor/bathroom_furniture.lua @@ -11,7 +11,8 @@ minetest.register_node("homedecor:bathroom_tiles_dark", { mesh = "homedecor_block_with_overlay.obj", paramtype = "light", paramtype2 = "color", - palette = "unifieddyes_palette.png", + palette = "unifieddyes_palette_extended.png", + place_param2 = 240, groups = {cracky=3, ud_param2_colorable = 1}, sounds = default.node_sound_stone_defaults(), after_dig_node = unifieddyes.after_dig_node @@ -27,7 +28,8 @@ minetest.register_node("homedecor:bathroom_tiles_medium", { mesh = "homedecor_block_with_overlay.obj", paramtype = "light", paramtype2 = "color", - palette = "unifieddyes_palette.png", + palette = "unifieddyes_palette_extended.png", + place_param2 = 240, groups = {cracky=3, ud_param2_colorable = 1}, sounds = default.node_sound_stone_defaults(), after_dig_node = unifieddyes.after_dig_node @@ -43,7 +45,8 @@ minetest.register_node("homedecor:bathroom_tiles_light", { mesh = "homedecor_block_with_overlay.obj", paramtype = "light", paramtype2 = "color", - palette = "unifieddyes_palette.png", + palette = "unifieddyes_palette_extended.png", + place_param2 = 240, groups = {cracky=3, ud_param2_colorable = 1}, sounds = default.node_sound_stone_defaults(), after_dig_node = unifieddyes.after_dig_node @@ -156,10 +159,29 @@ minetest.register_lbm({ color = color.."_s50" end - local paletteidx = unifieddyes.getpaletteidx("unifieddyes:"..color) + local paletteidx = unifieddyes.getpaletteidx("unifieddyes:"..color, "extended") minetest.set_node(pos, { name = newname, param2 = paletteidx }) local meta = minetest.get_meta(pos) meta:set_string("dye", "unifieddyes:"..color) + meta:set_string("palette", "ext") + end +}) + +minetest.register_lbm({ + name = "homedecor:recolor_bathroom_tiles", + label = "Convert bathroom tiles to use UD extended palette", + run_at_every_load = false, + nodenames = { + "homedecor:bathroom_tiles_light", + "homedecor:bathroom_tiles_medium", + "homedecor:bathroom_tiles_dark", + }, + action = function(pos, node) + local meta = minetest.get_meta(pos) + if meta:get_string("palette") ~= "ext" then + minetest.swap_node(pos, { name = node.name, param2 = unifieddyes.convert_classic_palette[node.param2] }) + meta:set_string("palette", "ext") + end end }) |