forked from nalc/homedecor_modpack
kaeza fixed node ownership detection for placing signs
This commit is contained in:
parent
cc97a0ebd9
commit
349748e100
@ -115,6 +115,12 @@ minetest.register_node(":default:sign_wall", {
|
|||||||
groups = sign_groups,
|
groups = sign_groups,
|
||||||
|
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
local def = minetest.registered_nodes[minetest.env:get_node(pointed_thing.above).name]
|
||||||
|
if homedecor_node_is_owned(pointed_thing.above, placer)
|
||||||
|
or (not def.buildable_to) then
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
|
||||||
local node=minetest.env:get_node(pointed_thing.under)
|
local node=minetest.env:get_node(pointed_thing.under)
|
||||||
if minetest.registered_nodes[node.name].on_rightclick then
|
if minetest.registered_nodes[node.name].on_rightclick then
|
||||||
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer)
|
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer)
|
||||||
@ -160,12 +166,6 @@ minetest.register_node(":default:sign_wall", {
|
|||||||
sign_info = signs[fdir + 1]
|
sign_info = signs[fdir + 1]
|
||||||
end
|
end
|
||||||
|
|
||||||
local def = minetest.registered_nodes[minetest.env:get_node(pointed_thing.above).name]
|
|
||||||
if homedecor_node_is_owned(pointed_thing.above, placer)
|
|
||||||
or (not def.buildable_to) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local text = minetest.env:add_entity({x = above.x + sign_info.delta.x,
|
local text = minetest.env:add_entity({x = above.x + sign_info.delta.x,
|
||||||
y = above.y + sign_info.delta.y,
|
y = above.y + sign_info.delta.y,
|
||||||
z = above.z + sign_info.delta.z}, "signs:text")
|
z = above.z + sign_info.delta.z}, "signs:text")
|
||||||
|
Loading…
Reference in New Issue
Block a user