forked from mtcontrib/homedecor_modpack
unified dyes uses on_use now, instead of on_rightclick
This commit is contained in:
parent
13059eb3a2
commit
a493933105
@ -45,7 +45,7 @@ homedecor.register("bed_regular", {
|
|||||||
paramtype2 = "colorwallmounted",
|
paramtype2 = "colorwallmounted",
|
||||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
palette = "unifieddyes_palette_colorwallmounted.png",
|
||||||
description = S("Bed"),
|
description = S("Bed"),
|
||||||
groups = {snappy=3},
|
groups = {snappy=3, ud_param2_colorable = 1},
|
||||||
selection_box = bed_sbox,
|
selection_box = bed_sbox,
|
||||||
node_box = bed_cbox,
|
node_box = bed_cbox,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
@ -61,10 +61,7 @@ homedecor.register("bed_regular", {
|
|||||||
end,
|
end,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
local itemname = itemstack:get_name()
|
local itemname = itemstack:get_name()
|
||||||
if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then
|
if itemname == "homedecor:bed_regular" then
|
||||||
unifieddyes.on_rightclick(pos, node, clicker,
|
|
||||||
itemstack, pointed_thing, "homedecor:bed_regular", "wallmounted")
|
|
||||||
elseif itemname == "homedecor:bed_regular" then
|
|
||||||
homedecor.bed_expansion(pos, clicker, itemstack, pointed_thing, true)
|
homedecor.bed_expansion(pos, clicker, itemstack, pointed_thing, true)
|
||||||
return itemstack
|
return itemstack
|
||||||
else
|
else
|
||||||
@ -90,25 +87,20 @@ homedecor.register("bed_extended", {
|
|||||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
palette = "unifieddyes_palette_colorwallmounted.png",
|
||||||
selection_box = bed_sbox,
|
selection_box = bed_sbox,
|
||||||
node_box = bed_cbox,
|
node_box = bed_cbox,
|
||||||
groups = {snappy=3},
|
groups = {snappy=3, ud_param2_colorable = 1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
expand = { forward = "air" },
|
expand = { forward = "air" },
|
||||||
on_rotate = screwdriver.disallow,
|
on_rotate = screwdriver.disallow,
|
||||||
after_dig_node = function(pos)
|
after_dig_node = function(pos)
|
||||||
homedecor.unextend_bed(pos)
|
homedecor.unextend_bed(pos)
|
||||||
end,
|
end,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
-- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
local itemname = itemstack:get_name()
|
-- local itemname = itemstack:get_name()
|
||||||
if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then
|
-- if minetest.get_modpath("beds") then
|
||||||
unifieddyes.on_rightclick(pos, node, clicker,
|
-- beds.on_rightclick(pos, clicker)
|
||||||
itemstack, pointed_thing, "homedecor:bed_extended", "wallmounted")
|
-- end
|
||||||
else
|
-- return itemstack
|
||||||
-- if minetest.get_modpath("beds") then
|
-- end,
|
||||||
-- beds.on_rightclick(pos, clicker)
|
|
||||||
-- end
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
drop = "homedecor:bed_regular"
|
drop = "homedecor:bed_regular"
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -125,9 +117,8 @@ homedecor.register("bed_kingsize", {
|
|||||||
paramtype2 = "colorwallmounted",
|
paramtype2 = "colorwallmounted",
|
||||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
palette = "unifieddyes_palette_colorwallmounted.png",
|
||||||
inventory_image = "homedecor_bed_kingsize_inv.png",
|
inventory_image = "homedecor_bed_kingsize_inv.png",
|
||||||
groups = {snappy=3, not_in_creative_inventory=1},
|
|
||||||
description = S("Bed (king sized)"),
|
description = S("Bed (king sized)"),
|
||||||
groups = {snappy=3, not_in_creative_inventory=1},
|
groups = {snappy=3, ud_param2_colorable = 1},
|
||||||
selection_box = kbed_sbox,
|
selection_box = kbed_sbox,
|
||||||
node_box = kbed_cbox,
|
node_box = kbed_cbox,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
@ -140,18 +131,13 @@ homedecor.register("bed_kingsize", {
|
|||||||
inv:add_item("main", "homedecor:bed_regular 2")
|
inv:add_item("main", "homedecor:bed_regular 2")
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
-- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
local itemname = itemstack:get_name()
|
-- local itemname = itemstack:get_name()
|
||||||
if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then
|
-- if minetest.get_modpath("beds") then
|
||||||
unifieddyes.on_rightclick(pos, node, clicker,
|
-- beds.on_rightclick(pos, clicker)
|
||||||
itemstack, pointed_thing, "homedecor:bed_kingsize", "wallmounted")
|
-- end
|
||||||
else
|
-- return itemstack
|
||||||
-- if minetest.get_modpath("beds") then
|
-- end
|
||||||
-- beds.on_rightclick(pos, clicker)
|
|
||||||
-- end
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
end
|
|
||||||
})
|
})
|
||||||
|
|
||||||
for _, w in pairs({ N_("mahogany"), N_("oak") }) do
|
for _, w in pairs({ N_("mahogany"), N_("oak") }) do
|
||||||
|
@ -66,7 +66,7 @@ homedecor.register("kitchen_chair_wood", {
|
|||||||
paramtype2 = "wallmounted",
|
paramtype2 = "wallmounted",
|
||||||
selection_box = kc_cbox,
|
selection_box = kc_cbox,
|
||||||
collision_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(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
after_place_node = homedecor.fix_rotation_nsew,
|
after_place_node = homedecor.fix_rotation_nsew,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
@ -88,20 +88,15 @@ homedecor.register("kitchen_chair_padded", {
|
|||||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
palette = "unifieddyes_palette_colorwallmounted.png",
|
||||||
selection_box = kc_cbox,
|
selection_box = kc_cbox,
|
||||||
collision_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(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
after_place_node = homedecor.fix_rotation_nsew,
|
after_place_node = homedecor.fix_rotation_nsew,
|
||||||
after_dig_node = unifieddyes.after_dig_node,
|
after_dig_node = unifieddyes.after_dig_node,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
local itemname = itemstack:get_name()
|
local itemname = itemstack:get_name()
|
||||||
if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then
|
pos.y = pos.y+0 -- where do I put my ass ?
|
||||||
unifieddyes.on_rightclick(pos, node, clicker,
|
homedecor.sit(pos, node, clicker)
|
||||||
itemstack, pointed_thing, "homedecor:kitchen_chair_padded", "wallmounted")
|
return itemstack
|
||||||
else
|
|
||||||
pos.y = pos.y+0 -- where do I put my ass ?
|
|
||||||
homedecor.sit(pos, node, clicker)
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -116,16 +111,11 @@ homedecor.register("armchair", {
|
|||||||
inventory_image = "homedecor_armchair_inv.png",
|
inventory_image = "homedecor_armchair_inv.png",
|
||||||
paramtype2 = "colorwallmounted",
|
paramtype2 = "colorwallmounted",
|
||||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
palette = "unifieddyes_palette_colorwallmounted.png",
|
||||||
groups = {snappy=3},
|
groups = {snappy=3, ud_param2_colorable = 1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
node_box = ac_cbox,
|
node_box = ac_cbox,
|
||||||
after_place_node = homedecor.fix_rotation_nsew,
|
after_place_node = homedecor.fix_rotation_nsew,
|
||||||
after_dig_node = unifieddyes.after_dig_node,
|
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 = {
|
local ob_cbox = {
|
||||||
|
@ -38,15 +38,11 @@ minetest.register_node("homedecor:glowlight_half", {
|
|||||||
wall_side = { -0.5, -0.5, -0.5, 0, 0.5, 0.5 }
|
wall_side = { -0.5, -0.5, -0.5, 0, 0.5, 0.5 }
|
||||||
},
|
},
|
||||||
node_box = glowlight_nodebox.half,
|
node_box = glowlight_nodebox.half,
|
||||||
groups = { snappy = 3 },
|
groups = { snappy = 3, ud_param2_colorable = 1 },
|
||||||
light_source = default.LIGHT_MAX,
|
light_source = default.LIGHT_MAX,
|
||||||
sounds = default.node_sound_glass_defaults(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
after_place_node = homedecor.fix_rotation,
|
after_place_node = homedecor.fix_rotation,
|
||||||
after_dig_node = unifieddyes.after_dig_node,
|
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,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("homedecor:glowlight_quarter", {
|
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 }
|
wall_side = { -0.5, -0.5, -0.5, -0.25, 0.5, 0.5 }
|
||||||
},
|
},
|
||||||
node_box = glowlight_nodebox.quarter,
|
node_box = glowlight_nodebox.quarter,
|
||||||
groups = { snappy = 3 },
|
groups = { snappy = 3, ud_param2_colorable = 1 },
|
||||||
light_source = default.LIGHT_MAX-1,
|
light_source = default.LIGHT_MAX-1,
|
||||||
sounds = default.node_sound_glass_defaults(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
after_place_node = homedecor.fix_rotation,
|
after_place_node = homedecor.fix_rotation,
|
||||||
after_dig_node = unifieddyes.after_dig_node,
|
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,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("homedecor:glowlight_small_cube", {
|
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 }
|
wall_side = { -0.5, -0.25, -0.25, 0, 0.25, 0.25 }
|
||||||
},
|
},
|
||||||
node_box = glowlight_nodebox.small_cube,
|
node_box = glowlight_nodebox.small_cube,
|
||||||
groups = { snappy = 3 },
|
groups = { snappy = 3, ud_param2_colorable = 1 },
|
||||||
light_source = default.LIGHT_MAX-1,
|
light_source = default.LIGHT_MAX-1,
|
||||||
sounds = default.node_sound_glass_defaults(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
after_place_node = homedecor.fix_rotation,
|
after_place_node = homedecor.fix_rotation,
|
||||||
after_dig_node = unifieddyes.after_dig_node,
|
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,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
homedecor.register("plasma_lamp", {
|
homedecor.register("plasma_lamp", {
|
||||||
@ -437,19 +425,15 @@ local function reg_lamp(suffix, nxt, light, brightness)
|
|||||||
light_source = light,
|
light_source = light,
|
||||||
selection_box = tlamp_cbox,
|
selection_box = tlamp_cbox,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
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,
|
not_in_creative_inventory=((light ~= nil) and 1) or nil,
|
||||||
},
|
},
|
||||||
drop = "homedecor:table_lamp_off",
|
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]
|
node.name = "homedecor:table_lamp_"..repl[suffix]
|
||||||
minetest.set_node(pos, node)
|
minetest.set_node(pos, node)
|
||||||
end,
|
end,
|
||||||
after_dig_node = unifieddyes.after_dig_node,
|
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,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
homedecor.register("standing_lamp_"..suffix, {
|
homedecor.register("standing_lamp_"..suffix, {
|
||||||
@ -467,21 +451,17 @@ local function reg_lamp(suffix, nxt, light, brightness)
|
|||||||
palette = "unifieddyes_palette.png",
|
palette = "unifieddyes_palette.png",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
light_source = light,
|
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,
|
not_in_creative_inventory=((light ~= nil) and 1) or nil,
|
||||||
},
|
},
|
||||||
selection_box = slamp_cbox,
|
selection_box = slamp_cbox,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
on_rotate = screwdriver.rotate_simple,
|
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]
|
node.name = "homedecor:standing_lamp_"..repl[suffix]
|
||||||
minetest.set_node(pos, node)
|
minetest.set_node(pos, node)
|
||||||
end,
|
end,
|
||||||
after_dig_node = unifieddyes.after_dig_node,
|
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" },
|
expand = { top="placeholder" },
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -518,13 +498,9 @@ homedecor.register("desk_lamp", {
|
|||||||
selection_box = dlamp_cbox,
|
selection_box = dlamp_cbox,
|
||||||
node_box = dlamp_cbox,
|
node_box = dlamp_cbox,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {snappy=3},
|
groups = {snappy=3, ud_param2_colorable = 1},
|
||||||
after_place_node = homedecor.fix_rotation_nsew,
|
after_place_node = homedecor.fix_rotation_nsew,
|
||||||
after_dig_node = unifieddyes.after_dig_node,
|
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,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- "kitchen"/"dining room" ceiling lamp
|
-- "kitchen"/"dining room" ceiling lamp
|
||||||
|
@ -33,16 +33,13 @@ homedecor.register("shutter", {
|
|||||||
inventory_image = inv,
|
inventory_image = inv,
|
||||||
wield_image = inv,
|
wield_image = inv,
|
||||||
paramtype2 = "wallmounted",
|
paramtype2 = "wallmounted",
|
||||||
groups = { snappy = 3 },
|
ud_replacement_node = "homedecor:shutter_colored",
|
||||||
|
groups = { snappy = 3, ud_param2_colorable = 1 },
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
selection_box = shutter_cbox,
|
selection_box = shutter_cbox,
|
||||||
node_box = shutter_cbox,
|
node_box = shutter_cbox,
|
||||||
after_place_node = homedecor.fix_rotation,
|
after_place_node = homedecor.fix_rotation,
|
||||||
after_dig_node = unifieddyes.after_dig_node,
|
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
|
|
||||||
})
|
})
|
||||||
|
|
||||||
homedecor.register("shutter_colored", {
|
homedecor.register("shutter_colored", {
|
||||||
@ -53,16 +50,12 @@ homedecor.register("shutter_colored", {
|
|||||||
wield_image = "homedecor_window_shutter_inv.png",
|
wield_image = "homedecor_window_shutter_inv.png",
|
||||||
paramtype2 = "colorwallmounted",
|
paramtype2 = "colorwallmounted",
|
||||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
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(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
selection_box = shutter_cbox,
|
selection_box = shutter_cbox,
|
||||||
node_box = shutter_cbox,
|
node_box = shutter_cbox,
|
||||||
after_place_node = homedecor.fix_rotation,
|
after_place_node = homedecor.fix_rotation,
|
||||||
after_dig_node = unifieddyes.after_dig_node,
|
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"
|
drop = "homedecor:shutter"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ minetest.register_node("homedecor:curtain_closed", {
|
|||||||
drawtype = 'signlike',
|
drawtype = 'signlike',
|
||||||
use_texture_alpha = true,
|
use_texture_alpha = true,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = { snappy = 3 },
|
groups = { snappy = 3, ud_param2_colorable = 1 },
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "colorwallmounted",
|
paramtype2 = "colorwallmounted",
|
||||||
@ -118,18 +118,13 @@ minetest.register_node("homedecor:curtain_closed", {
|
|||||||
after_place_node = homedecor.fix_rotation,
|
after_place_node = homedecor.fix_rotation,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
local itemname = itemstack:get_name()
|
local itemname = itemstack:get_name()
|
||||||
if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then
|
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
|
||||||
unifieddyes.on_rightclick(pos, node, clicker,
|
if string.find(topnode.name, "homedecor:curtainrod") then
|
||||||
itemstack, pointed_thing, "homedecor:curtain_closed", "wallmounted")
|
-- Open the curtains
|
||||||
else
|
local fdir = node.param2
|
||||||
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
|
minetest.set_node(pos, { name = "homedecor:curtain_open", param2 = fdir })
|
||||||
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
|
end
|
||||||
|
return itemstack
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -140,7 +135,7 @@ minetest.register_node("homedecor:curtain_open", {
|
|||||||
drawtype = 'signlike',
|
drawtype = 'signlike',
|
||||||
use_texture_alpha = true,
|
use_texture_alpha = true,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = { snappy = 3 },
|
groups = { snappy = 3, ud_param2_colorable = 1 },
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "colorwallmounted",
|
paramtype2 = "colorwallmounted",
|
||||||
@ -150,18 +145,13 @@ minetest.register_node("homedecor:curtain_open", {
|
|||||||
after_place_node = homedecor.fix_rotation,
|
after_place_node = homedecor.fix_rotation,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
local itemname = itemstack:get_name()
|
local itemname = itemstack:get_name()
|
||||||
if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then
|
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
|
||||||
unifieddyes.on_rightclick(pos, node, clicker,
|
if string.find(topnode.name, "homedecor:curtainrod") then
|
||||||
itemstack, pointed_thing, "homedecor:curtain_open", "wallmounted")
|
-- Close the curtains
|
||||||
else
|
local fdir = node.param2
|
||||||
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
|
minetest.set_node(pos, { name = "homedecor:curtain_closed", param2 = fdir })
|
||||||
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
|
end
|
||||||
|
return itemstack
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -30,19 +30,14 @@ minetest.register_node("lavalamp:lavalamp", {
|
|||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = { -0.25, -0.5, -0.25, 0.25,0.5, 0.25 },
|
fixed = { -0.25, -0.5, -0.25, 0.25,0.5, 0.25 },
|
||||||
},
|
},
|
||||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, ud_param2_colorable = 1},
|
||||||
sounds = default.node_sound_glass_defaults(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
after_dig_node = unifieddyes.after_dig_node,
|
after_dig_node = unifieddyes.after_dig_node,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
local itemname = itemstack:get_name()
|
local itemname = itemstack:get_name()
|
||||||
if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then
|
node.name = "lavalamp:lavalamp_off"
|
||||||
unifieddyes.on_rightclick(pos, node, clicker,
|
minetest.swap_node(pos, node)
|
||||||
itemstack, pointed_thing, "lavalamp:lavalamp", false)
|
return itemstack
|
||||||
else
|
|
||||||
node.name = "lavalamp:lavalamp_off"
|
|
||||||
minetest.swap_node(pos, node)
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -20,25 +20,20 @@ minetest.register_node("lrfurn:armchair", {
|
|||||||
paramtype2 = "colorwallmounted",
|
paramtype2 = "colorwallmounted",
|
||||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
palette = "unifieddyes_palette_colorwallmounted.png",
|
||||||
inventory_image = "lrfurn_armchair_inv.png",
|
inventory_image = "lrfurn_armchair_inv.png",
|
||||||
groups = {snappy=3},
|
groups = {snappy=3, ud_param2_colorable = 1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
node_box = armchair_cbox,
|
node_box = armchair_cbox,
|
||||||
after_place_node = lrfurn.fix_rotation,
|
after_place_node = lrfurn.fix_rotation,
|
||||||
after_dig_node = unifieddyes.after_dig_node,
|
after_dig_node = unifieddyes.after_dig_node,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
local itemname = itemstack:get_name()
|
local itemname = itemstack:get_name()
|
||||||
if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then
|
if not clicker:is_player() then
|
||||||
unifieddyes.on_rightclick(pos, node, clicker,
|
|
||||||
itemstack, pointed_thing, "lrfurn:armchair", "wallmounted")
|
|
||||||
else
|
|
||||||
if not clicker:is_player() then
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
pos.y = pos.y-0.5
|
|
||||||
clicker:setpos(pos)
|
|
||||||
clicker:set_hp(20)
|
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
pos.y = pos.y-0.5
|
||||||
|
clicker:setpos(pos)
|
||||||
|
clicker:set_hp(20)
|
||||||
|
return itemstack
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ minetest.register_node("lrfurn:longsofa", {
|
|||||||
paramtype2 = "colorwallmounted",
|
paramtype2 = "colorwallmounted",
|
||||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
palette = "unifieddyes_palette_colorwallmounted.png",
|
||||||
inventory_image = "lrfurn_longsofa_inv.png",
|
inventory_image = "lrfurn_longsofa_inv.png",
|
||||||
groups = {snappy=3},
|
groups = {snappy=3, ud_param2_colorable = 1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
selection_box = longsofa_cbox,
|
selection_box = longsofa_cbox,
|
||||||
node_box = longsofa_cbox,
|
node_box = longsofa_cbox,
|
||||||
@ -40,19 +40,13 @@ minetest.register_node("lrfurn:longsofa", {
|
|||||||
after_dig_node = unifieddyes.after_dig_node,
|
after_dig_node = unifieddyes.after_dig_node,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
local itemname = itemstack:get_name()
|
local itemname = itemstack:get_name()
|
||||||
if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then
|
if not clicker:is_player() then
|
||||||
unifieddyes.on_rightclick(pos, node, clicker,
|
|
||||||
itemstack, pointed_thing, "lrfurn:longsofa", "wallmounted")
|
|
||||||
else
|
|
||||||
if not clicker:is_player() then
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
|
|
||||||
pos.y = pos.y-0.5
|
|
||||||
clicker:setpos(pos)
|
|
||||||
clicker:set_hp(20)
|
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
pos.y = pos.y-0.5
|
||||||
|
clicker:setpos(pos)
|
||||||
|
clicker:set_hp(20)
|
||||||
|
return itemstack
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ minetest.register_node("lrfurn:sofa", {
|
|||||||
paramtype2 = "colorwallmounted",
|
paramtype2 = "colorwallmounted",
|
||||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
palette = "unifieddyes_palette_colorwallmounted.png",
|
||||||
inventory_image = "lrfurn_sofa_inv.png",
|
inventory_image = "lrfurn_sofa_inv.png",
|
||||||
groups = {snappy=3},
|
groups = {snappy=3, ud_param2_colorable = 1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
selection_box = sofa_cbox,
|
selection_box = sofa_cbox,
|
||||||
node_box = sofa_cbox,
|
node_box = sofa_cbox,
|
||||||
@ -40,19 +40,13 @@ minetest.register_node("lrfurn:sofa", {
|
|||||||
after_dig_node = unifieddyes.after_dig_node,
|
after_dig_node = unifieddyes.after_dig_node,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
local itemname = itemstack:get_name()
|
local itemname = itemstack:get_name()
|
||||||
if string.find(itemname, "dye:") or string.find(itemname, "unifieddyes:") then
|
if not clicker:is_player() then
|
||||||
unifieddyes.on_rightclick(pos, node, clicker,
|
|
||||||
itemstack, pointed_thing, "lrfurn:sofa", "wallmounted")
|
|
||||||
else
|
|
||||||
if not clicker:is_player() then
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
|
|
||||||
pos.y = pos.y-0.5
|
|
||||||
clicker:setpos(pos)
|
|
||||||
clicker:set_hp(20)
|
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
pos.y = pos.y-0.5
|
||||||
|
clicker:setpos(pos)
|
||||||
|
clicker:set_hp(20)
|
||||||
|
return itemstack
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user