summaryrefslogtreecommitdiff
path: root/homedecor
diff options
context:
space:
mode:
Diffstat (limited to 'homedecor')
-rw-r--r--homedecor/bathroom_sanitation.lua6
-rw-r--r--homedecor/bedroom.lua15
-rw-r--r--homedecor/books.lua3
-rw-r--r--homedecor/climate-control.lua2
-rw-r--r--homedecor/doors_and_gates.lua15
-rw-r--r--homedecor/furniture.lua3
-rw-r--r--homedecor/kitchen_appliances.lua6
-rw-r--r--homedecor/kitchen_furniture.lua3
-rw-r--r--homedecor/misc-nodes.lua8
-rw-r--r--homedecor/office.lua3
-rw-r--r--homedecor/window_treatments.lua6
11 files changed, 45 insertions, 25 deletions
diff --git a/homedecor/bathroom_sanitation.lua b/homedecor/bathroom_sanitation.lua
index b83e69a..d5d396a 100644
--- a/homedecor/bathroom_sanitation.lua
+++ b/homedecor/bathroom_sanitation.lua
@@ -114,7 +114,7 @@ homedecor.register("sink", {
--Taps
-local function taps_on_rightclick(pos, node, clicker)
+local function taps_on_rightclick(pos, node, clicker, itemstack, pointed_thing)
local below = minetest.get_node_or_nil({x=pos.x, y=pos.y-1, z=pos.z})
if below and
below.name == "homedecor:shower_tray" or
@@ -129,6 +129,7 @@ local function taps_on_rightclick(pos, node, clicker)
}
homedecor.start_particle_spawner(pos, node, particledef, "homedecor_faucet")
end
+ return itemstack
end
homedecor.register("taps", {
@@ -225,7 +226,7 @@ homedecor.register("shower_head", {
selection_box = sh_cbox,
walkable = false,
on_rotate = screwdriver.disallow,
- on_rightclick = function (pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local below = minetest.get_node_or_nil({x=pos.x, y=pos.y-2.0, z=pos.z})
if below and below.name == "homedecor:shower_tray" then
local particledef = {
@@ -237,6 +238,7 @@ homedecor.register("shower_head", {
}
homedecor.start_particle_spawner(pos, node, particledef, "homedecor_shower")
end
+ return itemstack
end,
on_destruct = function(pos)
homedecor.stop_particle_spawner(pos)
diff --git a/homedecor/bedroom.lua b/homedecor/bedroom.lua
index 683e53a..51c4dd5 100644
--- a/homedecor/bedroom.lua
+++ b/homedecor/bedroom.lua
@@ -79,10 +79,11 @@ for i in ipairs(bedcolors) do
after_dig_node = function(pos)
homedecor.unextend_bed(pos, color)
end,
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if minetest.get_modpath("beds") then
beds.on_rightclick(pos, clicker)
- else return end
+ end
+ return itemstack
end
})
@@ -104,10 +105,11 @@ for i in ipairs(bedcolors) do
after_dig_node = function(pos)
homedecor.unextend_bed(pos, color)
end,
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if minetest.get_modpath("beds") then
beds.on_rightclick(pos, clicker)
- else return end
+ end
+ return itemstack
end,
drop = "homedecor:bed_"..color.."_regular"
})
@@ -137,10 +139,11 @@ for i in ipairs(bedcolors) do
inv:add_item("main", "homedecor:bed_"..color.."_regular 2")
end
end,
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if minetest.get_modpath("beds") then
beds.on_rightclick(pos, clicker)
- else return end
+ end
+ return itemstack
end
})
diff --git a/homedecor/books.lua b/homedecor/books.lua
index 4783cb3..67da99e 100644
--- a/homedecor/books.lua
+++ b/homedecor/books.lua
@@ -112,7 +112,7 @@ for c in ipairs(bookcolors) do
drop = "homedecor:book_"..color,
walkable = false,
on_dig = book_dig,
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local meta = minetest.get_meta(pos)
local player_name = clicker:get_player_name()
local title = meta:get_string("title") or ""
@@ -136,6 +136,7 @@ for c in ipairs(bookcolors) do
end
player_current_book[player_name] = pos
minetest.show_formspec(player_name, BOOK_FORMNAME, formspec)
+ return itemstack
end,
on_punch = function(pos, node, puncher, pointed_thing)
local fdir = node.param2
diff --git a/homedecor/climate-control.lua b/homedecor/climate-control.lua
index 09f714e..462f450 100644
--- a/homedecor/climate-control.lua
+++ b/homedecor/climate-control.lua
@@ -111,7 +111,7 @@ homedecor.register("ceiling_fan", {
}
},
groups = { snappy = 3 },
- light_source = LIGHT_MAX-1,
+ light_source = default.LIGHT_MAX-1,
sounds = default.node_sound_glass_defaults(),
})
diff --git a/homedecor/doors_and_gates.lua b/homedecor/doors_and_gates.lua
index 82cdec3..3787e2b 100644
--- a/homedecor/doors_and_gates.lua
+++ b/homedecor/doors_and_gates.lua
@@ -252,8 +252,9 @@ for i in ipairs(sides) do
on_construct = function(pos)
minetest.get_meta(pos):set_int("closed", 1)
end,
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
homedecor.flip_door(pos, node, clicker, doorname, side)
+ return itemstack
end,
-- both left and right doors may be used for open or closed doors
-- so they have to have both action_on and action_off and just
@@ -385,8 +386,9 @@ for i in ipairs(gates_list) do
type = "fixed",
fixed = gate_models_closed[i]
},
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
homedecor.flip_gate(pos, node, clicker, gate, "closed")
+ return itemstack
end,
mesecons = {
effector = {
@@ -413,8 +415,9 @@ for i in ipairs(gates_list) do
tiles[3]
}
def.drop = "homedecor:gate_"..gate.."_closed"
- def.on_rightclick = function(pos, node, clicker)
+ def.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
homedecor.flip_gate(pos, node, clicker, gate, "open")
+ return itemstack
end
def.mesecons.effector = {
action_off = function(pos,node) homedecor.flip_gate(pos,node,player,gate, "open") end
@@ -605,8 +608,9 @@ homedecor.register("door_japanese_closed", {
fixed = {-0.5, -0.5, -0.0625, 0.5, 1.5, 0},
},
expand = { top = "placeholder" },
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
minetest.set_node(pos, {name = "homedecor:door_japanese_open", param2 = node.param2})
+ return itemstack
end
})
@@ -628,8 +632,9 @@ homedecor.register("door_japanese_open", {
fixed = {-1.5, -0.5, -0.0625, -0.5, 1.5, 0},
},
expand = { top = "placeholder" },
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
minetest.set_node(pos, {name = "homedecor:door_japanese_closed", param2 = node.param2})
+ return itemstack
end,
drop = "homedecor:door_japanese_closed",
})
diff --git a/homedecor/furniture.lua b/homedecor/furniture.lua
index 338a95c..fd79351 100644
--- a/homedecor/furniture.lua
+++ b/homedecor/furniture.lua
@@ -84,9 +84,10 @@ for i in ipairs(chaircolors) do
collision_box = kc_cbox,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
pos.y = pos.y+0 -- where do I put my ass ?
homedecor.sit(pos, node, clicker)
+ return itemstack
end
})
diff --git a/homedecor/kitchen_appliances.lua b/homedecor/kitchen_appliances.lua
index ae59a40..af3009b 100644
--- a/homedecor/kitchen_appliances.lua
+++ b/homedecor/kitchen_appliances.lua
@@ -169,7 +169,7 @@ homedecor.register("toaster", {
{-0.0625, -0.5, -0.125, 0.125, -0.3125, 0.125}, -- NodeBox1
},
},
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local fdir = node.param2
minetest.set_node(pos, { name = "homedecor:toaster_loaf", param2 = fdir })
minetest.sound_play("toaster", {
@@ -177,6 +177,7 @@ homedecor.register("toaster", {
gain = 1.0,
max_hear_distance = 5
})
+ return itemstack
end
})
@@ -199,9 +200,10 @@ homedecor.register("toaster_loaf", {
{0.0625, -0.3125, -0.0935, 0.0935, -0.25, 0.0935}, -- NodeBox3
},
},
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local fdir = node.param2
minetest.set_node(pos, { name = "homedecor:toaster", param2 = fdir })
+ return itemstack
end,
drop = "homedecor:toaster"
})
diff --git a/homedecor/kitchen_furniture.lua b/homedecor/kitchen_furniture.lua
index e64f423..cf240f8 100644
--- a/homedecor/kitchen_furniture.lua
+++ b/homedecor/kitchen_furniture.lua
@@ -117,7 +117,7 @@ homedecor.register("kitchen_faucet", {
selection_box = kf_cbox,
walkable = false,
on_rotate = screwdriver.disallow,
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local below = minetest.get_node_or_nil({x=pos.x, y=pos.y-1, z=pos.z})
if below and
below.name == "homedecor:sink" or
@@ -131,6 +131,7 @@ homedecor.register("kitchen_faucet", {
}
homedecor.start_particle_spawner(pos, node, particledef, "homedecor_faucet")
end
+ return itemstack
end,
on_destruct = homedecor.stop_particle_spawner
})
diff --git a/homedecor/misc-nodes.lua b/homedecor/misc-nodes.lua
index 67b341b..70322d4 100644
--- a/homedecor/misc-nodes.lua
+++ b/homedecor/misc-nodes.lua
@@ -179,8 +179,9 @@ homedecor.register("fishtank", {
collision_box = ft_cbox,
groups = {cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults(),
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
minetest.set_node(pos, {name = "homedecor:fishtank_lighted", param2 = node.param2})
+ return itemstack
end
})
@@ -195,14 +196,15 @@ homedecor.register("fishtank_lighted", {
"homedecor_fishtank_water_top_lighted.png",
"homedecor_fishtank_sides_lighted.png",
},
- light_source = LIGHT_MAX-4,
+ light_source = default.LIGHT_MAX-4,
use_texture_alpha = true,
selection_box = ft_cbox,
collision_box = ft_cbox,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
minetest.set_node(pos, {name = "homedecor:fishtank", param2 = node.param2})
+ return itemstack
end,
drop = "homedecor:fishtank",
})
diff --git a/homedecor/office.lua b/homedecor/office.lua
index 1da21dc..24fe30e 100644
--- a/homedecor/office.lua
+++ b/homedecor/office.lua
@@ -81,10 +81,11 @@ homedecor.register("calendar", {
legacy_wallmounted = true,
sounds = default.node_sound_defaults(),
infotext = "Date (right-click to update):\n" .. os.date("%Y-%m-%d"), -- ISO 8601 format
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local meta = minetest.get_meta(pos)
local date = os.date("%Y-%m-%d")
meta:set_string("infotext", "Date (right-click to update):\n"..date)
+ return itemstack
end
})
diff --git a/homedecor/window_treatments.lua b/homedecor/window_treatments.lua
index 2d9b125..1b7f915 100644
--- a/homedecor/window_treatments.lua
+++ b/homedecor/window_treatments.lua
@@ -125,12 +125,13 @@ for c in ipairs(curtaincolors) do
paramtype2 = 'wallmounted',
selection_box = { type = "wallmounted" },
-- Open the curtains
- on_rightclick = function(pos, node, clicker, itemstack)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
if string.find(topnode.name, "homedecor:curtainrod") then
local fdir = node.param2
minetest.set_node(pos, { name = "homedecor:curtain_open_"..color, param2 = fdir })
end
+ return itemstack
end
})
@@ -147,12 +148,13 @@ for c in ipairs(curtaincolors) do
paramtype2 = 'wallmounted',
selection_box = { type = "wallmounted" },
-- Close the curtains
- on_rightclick = function(pos, node, clicker, itemstack)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
if string.find(topnode.name, "homedecor:curtainrod") then
local fdir = node.param2
minetest.set_node(pos, { name = "homedecor:curtain_"..color, param2 = fdir })
end
+ return itemstack
end
})