From 9dcc6c2b4d2220f9a0e2d960a4d9b7c46f125df2 Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Thu, 18 Jul 2019 02:16:46 -0400 Subject: [PATCH] use Unified Dyes on_dig where needed - requires Unified Dyes commit 9ff40a7f or later --- homedecor_bathroom/init.lua | 3 +++ homedecor_bedroom/init.lua | 3 +++ homedecor_lighting/init.lua | 10 ++++++++-- homedecor_misc/init.lua | 1 + homedecor_seating/armchairs.lua | 2 ++ homedecor_seating/longsofas.lua | 1 + homedecor_seating/misc.lua | 1 + homedecor_seating/sofas.lua | 1 + homedecor_windows_and_treatments/init.lua | 4 ++++ lavalamp/init.lua | 1 + 10 files changed, 25 insertions(+), 2 deletions(-) diff --git a/homedecor_bathroom/init.lua b/homedecor_bathroom/init.lua index a043d899..85cf43a8 100644 --- a/homedecor_bathroom/init.lua +++ b/homedecor_bathroom/init.lua @@ -15,6 +15,7 @@ minetest.register_node(":homedecor:bathroom_tiles_dark", { groups = {cracky=3, ud_param2_colorable = 1}, sounds = default.node_sound_stone_defaults(), on_construct = unifieddyes.on_construct, + on_dig = unifieddyes.on_dig, }) minetest.register_node(":homedecor:bathroom_tiles_medium", { @@ -31,6 +32,7 @@ minetest.register_node(":homedecor:bathroom_tiles_medium", { groups = {cracky=3, ud_param2_colorable = 1}, sounds = default.node_sound_stone_defaults(), on_construct = unifieddyes.on_construct, + on_dig = unifieddyes.on_dig, }) minetest.register_node(":homedecor:bathroom_tiles_light", { @@ -47,6 +49,7 @@ minetest.register_node(":homedecor:bathroom_tiles_light", { groups = {cracky=3, ud_param2_colorable = 1}, sounds = default.node_sound_stone_defaults(), on_construct = unifieddyes.on_construct, + on_dig = unifieddyes.on_dig, }) local tr_cbox = { diff --git a/homedecor_bedroom/init.lua b/homedecor_bedroom/init.lua index fc3f7339..b0e25573 100644 --- a/homedecor_bedroom/init.lua +++ b/homedecor_bedroom/init.lua @@ -59,6 +59,7 @@ homedecor.register("bed_regular", { after_dig_node = function(pos, oldnode, oldmetadata, digger) homedecor.unextend_bed(pos) end, + on_dig = unifieddyes.on_dig, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) local itemname = itemstack:get_name() if itemname == "homedecor:bed_regular" then @@ -92,6 +93,7 @@ homedecor.register("bed_extended", { after_dig_node = function(pos, oldnode, oldmetadata, digger) homedecor.unextend_bed(pos) end, + on_dig = unifieddyes.on_dig, -- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) -- homedecor.beds_on_rightclick(pos, node, clicker) -- return itemstack @@ -128,6 +130,7 @@ homedecor.register("bed_kingsize", { inv:add_item("main", "homedecor:bed_regular 2") end end, + on_dig = unifieddyes.on_dig, -- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) -- homedecor.beds_on_rightclick(pos, node, clicker) -- return itemstack diff --git a/homedecor_lighting/init.lua b/homedecor_lighting/init.lua index 4258129b..157ddab4 100644 --- a/homedecor_lighting/init.lua +++ b/homedecor_lighting/init.lua @@ -286,6 +286,7 @@ for brightness_level = 0, 14 do after_place_node = function(pos, placer, itemstack, pointed_thing) unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) end, + on_dig = unifieddyes.on_dig, on_rightclick = homedecor.toggle_light, drop = { items = { @@ -351,6 +352,7 @@ for brightness_level = 0, 14 do after_place_node = function(pos, placer, itemstack, pointed_thing) unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) end, + on_dig = unifieddyes.on_dig, on_rightclick = homedecor.toggle_light, drop = { items = { @@ -417,6 +419,7 @@ for brightness_level = 0, 14 do after_place_node = function(pos, placer, itemstack, pointed_thing) unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) end, + on_dig = unifieddyes.on_dig, on_rightclick = homedecor.toggle_light, drop = { items = { @@ -637,6 +640,7 @@ for brightness_level = 0, 14 do after_place_node = function(pos, placer, itemstack, pointed_thing) unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing) end, + on_dig = unifieddyes.on_dig, on_rotate = unifieddyes.fix_after_screwdriver_nsew, light_source = brightness_level, on_rightclick = homedecor.toggle_light, @@ -714,7 +718,8 @@ for brightness_level = 0, 14 do digiline = homedecor.digiline_alldir_light, mesecons = homedecor.mesecon_wall_light, on_rightclick = homedecor.toggle_light, - on_punch = digiline_on_punch + on_punch = digiline_on_punch, + on_dig = unifieddyes.on_dig, }) homedecor.register("standing_lamp_"..brightness_level, { @@ -745,7 +750,8 @@ for brightness_level = 0, 14 do digiline = homedecor.digiline_alldir_light, mesecons = homedecor.mesecon_wall_light, on_rightclick = homedecor.toggle_light, - on_punch = digiline_on_punch + on_punch = digiline_on_punch, + on_dig = unifieddyes.on_dig, }) end diff --git a/homedecor_misc/init.lua b/homedecor_misc/init.lua index 95135aef..9c85b96f 100644 --- a/homedecor_misc/init.lua +++ b/homedecor_misc/init.lua @@ -478,6 +478,7 @@ for _, side in ipairs({"diagonal_left", "diagonal_right", "horizontal"}) do def.airbrush_replacement_node = "homedecor:banister_wood_"..side.."_grey" def.groups.ud_param2_colorable = 1 def.paramtype2 = "colorfacedir" + def.on_dig = unifieddyes.on_dig end homedecor.register(nodename, def) diff --git a/homedecor_seating/armchairs.lua b/homedecor_seating/armchairs.lua index 202cedb4..13d74bda 100644 --- a/homedecor_seating/armchairs.lua +++ b/homedecor_seating/armchairs.lua @@ -26,6 +26,7 @@ minetest.register_node(":lrfurn:armchair", { after_place_node = function(pos, placer, itemstack, pointed_thing) unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing) end, + on_dig = unifieddyes.on_dig, on_rotate = unifieddyes.fix_after_screwdriver_nsew, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) if not clicker:is_player() then @@ -55,6 +56,7 @@ homedecor.register("armchair", { after_place_node = function(pos, placer, itemstack, pointed_thing) unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing) end, + on_dig = unifieddyes.on_dig, on_rotate = unifieddyes.fix_after_screwdriver_nsew, }) diff --git a/homedecor_seating/longsofas.lua b/homedecor_seating/longsofas.lua index 4ee5ef5b..b9ed4e96 100644 --- a/homedecor_seating/longsofas.lua +++ b/homedecor_seating/longsofas.lua @@ -41,6 +41,7 @@ minetest.register_node(":lrfurn:longsofa", { end return itemstack end, + on_dig = unifieddyes.on_dig, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) if not clicker:is_player() then return itemstack diff --git a/homedecor_seating/misc.lua b/homedecor_seating/misc.lua index 1dd6d412..29121ff6 100644 --- a/homedecor_seating/misc.lua +++ b/homedecor_seating/misc.lua @@ -153,6 +153,7 @@ homedecor.register("kitchen_chair_padded", { after_place_node = function(pos, placer, itemstack, pointed_thing) unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing) end, + on_dig = unifieddyes.on_dig, on_rotate = unifieddyes.fix_after_screwdriver_nsew, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) pos.y = pos.y+0 -- where do I put my ass ? diff --git a/homedecor_seating/sofas.lua b/homedecor_seating/sofas.lua index eb8d3802..94febb19 100644 --- a/homedecor_seating/sofas.lua +++ b/homedecor_seating/sofas.lua @@ -41,6 +41,7 @@ minetest.register_node(":lrfurn:sofa", { end return itemstack end, + on_dig = unifieddyes.on_dig, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) if not clicker:is_player() then return itemstack diff --git a/homedecor_windows_and_treatments/init.lua b/homedecor_windows_and_treatments/init.lua index 155221cd..3f17e48e 100644 --- a/homedecor_windows_and_treatments/init.lua +++ b/homedecor_windows_and_treatments/init.lua @@ -115,6 +115,7 @@ minetest.register_node(":homedecor:curtain_closed", { after_place_node = function(pos, placer, itemstack, pointed_thing) unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) end, + on_dig = unifieddyes.on_dig, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) minetest.set_node(pos, { name = "homedecor:curtain_open", param2 = node.param2 }) return itemstack @@ -137,6 +138,7 @@ minetest.register_node(":homedecor:curtain_open", { after_place_node = function(pos, placer, itemstack, pointed_thing) unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) end, + on_dig = unifieddyes.on_dig, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) minetest.set_node(pos, { name = "homedecor:curtain_closed", param2 = node.param2 }) return itemstack @@ -243,6 +245,7 @@ homedecor.register("shutter", { after_place_node = function(pos, placer, itemstack, pointed_thing) unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) end, + on_dig = unifieddyes.on_dig, }) homedecor.register("shutter_colored", { @@ -260,6 +263,7 @@ homedecor.register("shutter_colored", { after_place_node = function(pos, placer, itemstack, pointed_thing) unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) end, + on_dig = unifieddyes.on_dig, }) minetest.register_alias("homedecor:shutter_purple", "homedecor:shutter_violet") diff --git a/lavalamp/init.lua b/lavalamp/init.lua index bf68aa93..39172c94 100644 --- a/lavalamp/init.lua +++ b/lavalamp/init.lua @@ -38,6 +38,7 @@ minetest.register_node("lavalamp:lavalamp", { groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, ud_param2_colorable = 1}, sounds = default.node_sound_glass_defaults(), on_construct = unifieddyes.on_construct, + on_dig = unifieddyes.on_dig, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) node.name = "lavalamp:lavalamp_off" minetest.swap_node(pos, node)