From 921c05da0d057469032fe9aced321503f1f0d498 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sat, 4 Feb 2017 20:11:09 -0500 Subject: updated several mods to use newer unified dyes API blox, bobblocks, coloredwood, framedglass, homedecor, ilights, plasticbox, stained_glass, unifiedbricks, and of course unified dyes. --- homedecor/bedroom.lua | 50 +++++++++++++++-------------------------- homedecor/crafts.lua | 34 ++++++++++++---------------- homedecor/furniture.lua | 22 +++++------------- homedecor/furniture_recipes.lua | 2 +- homedecor/lighting.lua | 50 +++++++++++------------------------------ homedecor/shutters.lua | 15 ++++--------- homedecor/window_treatments.lua | 38 ++++++++++++------------------- 7 files changed, 70 insertions(+), 141 deletions(-) (limited to 'homedecor') diff --git a/homedecor/bedroom.lua b/homedecor/bedroom.lua index 79c573b..8e29ee3 100644 --- a/homedecor/bedroom.lua +++ b/homedecor/bedroom.lua @@ -45,7 +45,7 @@ homedecor.register("bed_regular", { paramtype2 = "colorwallmounted", palette = "unifieddyes_palette_colorwallmounted.png", description = S("Bed"), - groups = {snappy=3}, + groups = {snappy=3, ud_param2_colorable = 1}, selection_box = bed_sbox, node_box = bed_cbox, sounds = default.node_sound_wood_defaults(), @@ -61,10 +61,7 @@ homedecor.register("bed_regular", { end, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) local itemname = itemstack:get_name() - if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then - unifieddyes.on_rightclick(pos, node, clicker, - itemstack, pointed_thing, "homedecor:bed_regular", "wallmounted") - elseif itemname == "homedecor:bed_regular" then + if itemname == "homedecor:bed_regular" then homedecor.bed_expansion(pos, clicker, itemstack, pointed_thing, true) return itemstack else @@ -90,25 +87,20 @@ homedecor.register("bed_extended", { palette = "unifieddyes_palette_colorwallmounted.png", selection_box = bed_sbox, node_box = bed_cbox, - groups = {snappy=3}, + groups = {snappy=3, ud_param2_colorable = 1}, sounds = default.node_sound_wood_defaults(), expand = { forward = "air" }, on_rotate = screwdriver.disallow, after_dig_node = function(pos) homedecor.unextend_bed(pos) end, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - local itemname = itemstack:get_name() - if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then - unifieddyes.on_rightclick(pos, node, clicker, - itemstack, pointed_thing, "homedecor:bed_extended", "wallmounted") - else --- if minetest.get_modpath("beds") then --- beds.on_rightclick(pos, clicker) --- end - return itemstack - end - end, +-- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) +-- local itemname = itemstack:get_name() +-- if minetest.get_modpath("beds") then +-- beds.on_rightclick(pos, clicker) +-- end +-- return itemstack +-- end, drop = "homedecor:bed_regular" }) @@ -125,9 +117,8 @@ homedecor.register("bed_kingsize", { paramtype2 = "colorwallmounted", palette = "unifieddyes_palette_colorwallmounted.png", inventory_image = "homedecor_bed_kingsize_inv.png", - groups = {snappy=3, not_in_creative_inventory=1}, description = S("Bed (king sized)"), - groups = {snappy=3, not_in_creative_inventory=1}, + groups = {snappy=3, ud_param2_colorable = 1}, selection_box = kbed_sbox, node_box = kbed_cbox, sounds = default.node_sound_wood_defaults(), @@ -140,18 +131,13 @@ homedecor.register("bed_kingsize", { inv:add_item("main", "homedecor:bed_regular 2") end end, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - local itemname = itemstack:get_name() - if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then - unifieddyes.on_rightclick(pos, node, clicker, - itemstack, pointed_thing, "homedecor:bed_kingsize", "wallmounted") - else --- if minetest.get_modpath("beds") then --- beds.on_rightclick(pos, clicker) --- end - return itemstack - end - end +-- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) +-- local itemname = itemstack:get_name() +-- if minetest.get_modpath("beds") then +-- beds.on_rightclick(pos, clicker) +-- end +-- return itemstack +-- end }) for _, w in pairs({ N_("mahogany"), N_("oak") }) do diff --git a/homedecor/crafts.lua b/homedecor/crafts.lua index b887c2d..9877f84 100644 --- a/homedecor/crafts.lua +++ b/homedecor/crafts.lua @@ -2488,27 +2488,21 @@ local bedcolors = { { "brown", "brown" }, } -for c in ipairs(bedcolors) do - local color = bedcolors[c][1] - local woolcolor = bedcolors[c][2] - - minetest.register_craft( { - output = "homedecor:bed_"..color.."_regular", - recipe = { - { "group:stick", "", "group:stick" }, - { "wool:white", "wool:"..woolcolor, "wool:"..woolcolor }, - { "group:wood", "", "group:wood" }, - }, - }) - - minetest.register_craft( { - output = "homedecor:bed_"..color.."_kingsize", - recipe = { - { "homedecor:bed_"..color.."_regular", "homedecor:bed_"..color.."_regular" } - }, - }) +minetest.register_craft( { + output = "homedecor:bed_regular", + recipe = { + { "group:stick", "", "group:stick" }, + { "wool:white", "wool:white", "wool:white" }, + { "group:wood", "", "group:wood" }, + }, +}) -end +minetest.register_craft( { + output = "homedecor:bed_kingsize", + recipe = { + { "homedecor:bed_regular", "homedecor:bed_regular" } + }, +}) minetest.register_craft( { output = "homedecor:bottle_green", diff --git a/homedecor/furniture.lua b/homedecor/furniture.lua index 8f60c5d..d1e24a9 100644 --- a/homedecor/furniture.lua +++ b/homedecor/furniture.lua @@ -66,7 +66,7 @@ homedecor.register("kitchen_chair_wood", { paramtype2 = "wallmounted", selection_box = kc_cbox, collision_box = kc_cbox, - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, + groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, ud_param2_colorable = 1}, sounds = default.node_sound_wood_defaults(), after_place_node = homedecor.fix_rotation_nsew, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) @@ -88,20 +88,15 @@ homedecor.register("kitchen_chair_padded", { palette = "unifieddyes_palette_colorwallmounted.png", selection_box = kc_cbox, collision_box = kc_cbox, - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, + groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, ud_param2_colorable = 1}, sounds = default.node_sound_wood_defaults(), after_place_node = homedecor.fix_rotation_nsew, after_dig_node = unifieddyes.after_dig_node, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) local itemname = itemstack:get_name() - if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then - unifieddyes.on_rightclick(pos, node, clicker, - itemstack, pointed_thing, "homedecor:kitchen_chair_padded", "wallmounted") - else - pos.y = pos.y+0 -- where do I put my ass ? - homedecor.sit(pos, node, clicker) - return itemstack - end + pos.y = pos.y+0 -- where do I put my ass ? + homedecor.sit(pos, node, clicker) + return itemstack end }) @@ -116,16 +111,11 @@ homedecor.register("armchair", { inventory_image = "homedecor_armchair_inv.png", paramtype2 = "colorwallmounted", palette = "unifieddyes_palette_colorwallmounted.png", - groups = {snappy=3}, + groups = {snappy=3, ud_param2_colorable = 1}, sounds = default.node_sound_wood_defaults(), node_box = ac_cbox, after_place_node = homedecor.fix_rotation_nsew, after_dig_node = unifieddyes.after_dig_node, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - local itemname = itemstack:get_name() - unifieddyes.on_rightclick(pos, node, clicker, - itemstack, pointed_thing, "homedecor:armchair", "wallmounted") - end }) local ob_cbox = { diff --git a/homedecor/furniture_recipes.lua b/homedecor/furniture_recipes.lua index 9ece79f..e64e849 100644 --- a/homedecor/furniture_recipes.lua +++ b/homedecor/furniture_recipes.lua @@ -1,6 +1,6 @@ minetest.register_craft({ - output = "homedecor:table", "homedecor:kitchen_chair_wood 2", + output = "homedecor:table", recipe = { { "group:wood","group:wood", "group:wood" }, { "group:stick", "", "group:stick" }, diff --git a/homedecor/lighting.lua b/homedecor/lighting.lua index 5b29338..0a1edaf 100644 --- a/homedecor/lighting.lua +++ b/homedecor/lighting.lua @@ -38,15 +38,11 @@ minetest.register_node("homedecor:glowlight_half", { wall_side = { -0.5, -0.5, -0.5, 0, 0.5, 0.5 } }, node_box = glowlight_nodebox.half, - groups = { snappy = 3 }, + groups = { snappy = 3, ud_param2_colorable = 1 }, light_source = default.LIGHT_MAX, sounds = default.node_sound_glass_defaults(), after_place_node = homedecor.fix_rotation, - after_dig_node = unifieddyes.after_dig_node, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - unifieddyes.on_rightclick(pos, node, clicker, - itemstack, pointed_thing, "homedecor:glowlight_half", "wallmounted") - end, + after_dig_node = unifieddyes.after_dig_node }) minetest.register_node("homedecor:glowlight_quarter", { @@ -70,15 +66,11 @@ minetest.register_node("homedecor:glowlight_quarter", { wall_side = { -0.5, -0.5, -0.5, -0.25, 0.5, 0.5 } }, node_box = glowlight_nodebox.quarter, - groups = { snappy = 3 }, + groups = { snappy = 3, ud_param2_colorable = 1 }, light_source = default.LIGHT_MAX-1, sounds = default.node_sound_glass_defaults(), after_place_node = homedecor.fix_rotation, - after_dig_node = unifieddyes.after_dig_node, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - unifieddyes.on_rightclick(pos, node, clicker, - itemstack, pointed_thing, "homedecor:glowlight_quarter", "wallmounted") - end, + after_dig_node = unifieddyes.after_dig_node }) minetest.register_node("homedecor:glowlight_small_cube", { @@ -102,15 +94,11 @@ minetest.register_node("homedecor:glowlight_small_cube", { wall_side = { -0.5, -0.25, -0.25, 0, 0.25, 0.25 } }, node_box = glowlight_nodebox.small_cube, - groups = { snappy = 3 }, + groups = { snappy = 3, ud_param2_colorable = 1 }, light_source = default.LIGHT_MAX-1, sounds = default.node_sound_glass_defaults(), after_place_node = homedecor.fix_rotation, - after_dig_node = unifieddyes.after_dig_node, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - unifieddyes.on_rightclick(pos, node, clicker, - itemstack, pointed_thing, "homedecor:glowlight_small_cube", "wallmounted") - end, + after_dig_node = unifieddyes.after_dig_node }) homedecor.register("plasma_lamp", { @@ -437,19 +425,15 @@ local function reg_lamp(suffix, nxt, light, brightness) light_source = light, selection_box = tlamp_cbox, sounds = default.node_sound_wood_defaults(), - groups = {cracky=2,oddly_breakable_by_hand=1, + groups = {cracky=2,oddly_breakable_by_hand=1, ud_param2_colorable = 1, not_in_creative_inventory=((light ~= nil) and 1) or nil, }, drop = "homedecor:table_lamp_off", - on_punch = function(pos, node, puncher) + on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) node.name = "homedecor:table_lamp_"..repl[suffix] minetest.set_node(pos, node) end, - after_dig_node = unifieddyes.after_dig_node, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - unifieddyes.on_rightclick(pos, node, clicker, - itemstack, pointed_thing, "homedecor:table_lamp_"..suffix, false) - end, + after_dig_node = unifieddyes.after_dig_node }) homedecor.register("standing_lamp_"..suffix, { @@ -467,21 +451,17 @@ local function reg_lamp(suffix, nxt, light, brightness) palette = "unifieddyes_palette.png", walkable = false, light_source = light, - groups = {cracky=2,oddly_breakable_by_hand=1, + groups = {cracky=2,oddly_breakable_by_hand=1, ud_param2_colorable = 1, not_in_creative_inventory=((light ~= nil) and 1) or nil, }, selection_box = slamp_cbox, sounds = default.node_sound_wood_defaults(), on_rotate = screwdriver.rotate_simple, - on_punch = function(pos, node, puncher) + on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) node.name = "homedecor:standing_lamp_"..repl[suffix] minetest.set_node(pos, node) end, after_dig_node = unifieddyes.after_dig_node, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - unifieddyes.on_rightclick(pos, node, clicker, - itemstack, pointed_thing, "homedecor:standing_lamp_"..suffix, false) - end, expand = { top="placeholder" }, }) @@ -518,13 +498,9 @@ homedecor.register("desk_lamp", { selection_box = dlamp_cbox, node_box = dlamp_cbox, walkable = false, - groups = {snappy=3}, + groups = {snappy=3, ud_param2_colorable = 1}, after_place_node = homedecor.fix_rotation_nsew, - after_dig_node = unifieddyes.after_dig_node, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - unifieddyes.on_rightclick(pos, node, clicker, - itemstack, pointed_thing, "homedecor:desk_lamp", "wallmounted") - end, + after_dig_node = unifieddyes.after_dig_node }) -- "kitchen"/"dining room" ceiling lamp diff --git a/homedecor/shutters.lua b/homedecor/shutters.lua index 733632b..8feb0e7 100644 --- a/homedecor/shutters.lua +++ b/homedecor/shutters.lua @@ -33,16 +33,13 @@ homedecor.register("shutter", { inventory_image = inv, wield_image = inv, paramtype2 = "wallmounted", - groups = { snappy = 3 }, + ud_replacement_node = "homedecor:shutter_colored", + groups = { snappy = 3, ud_param2_colorable = 1 }, sounds = default.node_sound_wood_defaults(), selection_box = shutter_cbox, node_box = shutter_cbox, after_place_node = homedecor.fix_rotation, - after_dig_node = unifieddyes.after_dig_node, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - unifieddyes.on_rightclick(pos, node, clicker, - itemstack, pointed_thing, "homedecor:shutter_colored", "wallmounted") - end + after_dig_node = unifieddyes.after_dig_node }) homedecor.register("shutter_colored", { @@ -53,16 +50,12 @@ homedecor.register("shutter_colored", { wield_image = "homedecor_window_shutter_inv.png", paramtype2 = "colorwallmounted", palette = "unifieddyes_palette_colorwallmounted.png", - groups = { snappy = 3 , not_in_creative_inventory = 1}, + groups = { snappy = 3 , not_in_creative_inventory = 1, ud_param2_colorable = 1}, sounds = default.node_sound_wood_defaults(), selection_box = shutter_cbox, node_box = shutter_cbox, after_place_node = homedecor.fix_rotation, after_dig_node = unifieddyes.after_dig_node, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - unifieddyes.on_rightclick(pos, node, clicker, - itemstack, pointed_thing, "homedecor:shutter_colored", "wallmounted") - end, drop = "homedecor:shutter" }) diff --git a/homedecor/window_treatments.lua b/homedecor/window_treatments.lua index 27be83d..c09f2dd 100644 --- a/homedecor/window_treatments.lua +++ b/homedecor/window_treatments.lua @@ -108,7 +108,7 @@ minetest.register_node("homedecor:curtain_closed", { drawtype = 'signlike', use_texture_alpha = true, walkable = false, - groups = { snappy = 3 }, + groups = { snappy = 3, ud_param2_colorable = 1 }, sounds = default.node_sound_leaves_defaults(), paramtype = "light", paramtype2 = "colorwallmounted", @@ -118,18 +118,13 @@ minetest.register_node("homedecor:curtain_closed", { after_place_node = homedecor.fix_rotation, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) local itemname = itemstack:get_name() - if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then - unifieddyes.on_rightclick(pos, node, clicker, - itemstack, pointed_thing, "homedecor:curtain_closed", "wallmounted") - else - local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z}) - if string.find(topnode.name, "homedecor:curtainrod") then - -- Open the curtains - local fdir = node.param2 - minetest.set_node(pos, { name = "homedecor:curtain_open", param2 = fdir }) - end - return itemstack + local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z}) + if string.find(topnode.name, "homedecor:curtainrod") then + -- Open the curtains + local fdir = node.param2 + minetest.set_node(pos, { name = "homedecor:curtain_open", param2 = fdir }) end + return itemstack end }) @@ -140,7 +135,7 @@ minetest.register_node("homedecor:curtain_open", { drawtype = 'signlike', use_texture_alpha = true, walkable = false, - groups = { snappy = 3 }, + groups = { snappy = 3, ud_param2_colorable = 1 }, sounds = default.node_sound_leaves_defaults(), paramtype = "light", paramtype2 = "colorwallmounted", @@ -150,18 +145,13 @@ minetest.register_node("homedecor:curtain_open", { after_place_node = homedecor.fix_rotation, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) local itemname = itemstack:get_name() - if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then - unifieddyes.on_rightclick(pos, node, clicker, - itemstack, pointed_thing, "homedecor:curtain_open", "wallmounted") - else - local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z}) - if string.find(topnode.name, "homedecor:curtainrod") then - -- Close the curtains - local fdir = node.param2 - minetest.set_node(pos, { name = "homedecor:curtain_closed", param2 = fdir }) - end - return itemstack + local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z}) + if string.find(topnode.name, "homedecor:curtainrod") then + -- Close the curtains + local fdir = node.param2 + minetest.set_node(pos, { name = "homedecor:curtain_closed", param2 = fdir }) end + return itemstack end }) -- cgit v1.2.3