destruct_bed(pos, 1)
end,
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
beds.on_rightclick(pos, clicker)
+ return itemstack
end,
on_rotate = function(pos, node, user, mode, new_param2)
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then
- return
+ return itemstack
end
if not is_water(pointed_thing.under) then
- return
+ return itemstack
end
pointed_thing.under.y = pointed_thing.under.y + 0.5
minetest.add_entity(pointed_thing.under, "boats:boat")
" takes " .. stack:get_name() ..
" from locked chest at " .. minetest.pos_to_string(pos))
end,
- on_rightclick = function(pos, node, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local meta = minetest.get_meta(pos)
if has_locked_chest_privilege(meta, clicker) then
minetest.show_formspec(
get_locked_chest_formspec(pos)
)
end
+ return itemstack
end,
on_blast = function() end,
})
sounds = { def.sound_close, def.sound_open },
}
- def.on_rightclick = function(pos, node, clicker)
+ def.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
_doors.door_toggle(pos, clicker)
+ return itemstack
end
def.after_dig_node = function(pos, node, meta, digger)
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
return meta:get_string("doors_owner") == pn
end
- def.on_rightclick = function(pos, node, clicker)
+ def.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
_doors.trapdoor_toggle(pos, clicker)
+ return itemstack
end
-- Common trapdoor configuration
connect_sides = {"left", "right"},
groups = def.groups,
sounds = def.sounds,
- on_rightclick = function(pos, clicker)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local node = minetest.get_node(pos)
local node_def = minetest.registered_nodes[node.name]
minetest.swap_node(pos, {name = node_def.gate, param2 = node.param2})
minetest.sound_play(node_def.sound, {pos = pos, gain = 0.3,
max_hear_distance = 8})
+ return itemstack
end,
selection_box = {
type = "fixed",
local pt = pointed_thing
-- check if pointing at a node
if not pt then
- return
+ return itemstack
end
if pt.type ~= "node" then
- return
+ return itemstack
end
local under = minetest.get_node(pt.under)
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] then
- return
+ return itemstack
end
if not minetest.registered_nodes[above.name] then
- return
+ return itemstack
end
-- check if pointing at the top of the node
if pt.above.y ~= pt.under.y+1 then
- return
+ return itemstack
end
-- check if you can replace the node above the pointed node
if not minetest.registered_nodes[above.name].buildable_to then
- return
+ return itemstack
end
-- check if pointing at soil
if minetest.get_item_group(under.name, "soil") < 2 then
- return
+ return itemstack
end
-- add the node and remove 1 item from the itemstack
end
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
- return itemstack
end
end
+ return itemstack
end
})