forked from nalc/homedecor_modpack
commit
5fe3519aab
4
init.lua
4
init.lua
@ -49,6 +49,10 @@ function homedecor_node_is_owned(pos, placer)
|
||||
if not isprotect(5, pos, placer) then
|
||||
ownername = S("someone")
|
||||
end
|
||||
elseif type(protector)=="table" and type(protector.can_dig)=="function" then -- Zeg9's protection mod
|
||||
if not protector.can_dig(5, pos, placer) then
|
||||
ownername = S("someone")
|
||||
end
|
||||
end
|
||||
|
||||
if ownername ~= false then
|
||||
|
@ -115,11 +115,20 @@ minetest.register_node(":default:sign_wall", {
|
||||
groups = sign_groups,
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local def = minetest.registered_nodes[minetest.env:get_node(pointed_thing.above).name]
|
||||
local name
|
||||
name = minetest.env:get_node(pointed_thing.under).name
|
||||
if fences_with_sign[name] then
|
||||
if homedecor_node_is_owned(pointed_thing.under, placer) then
|
||||
return itemstack
|
||||
end
|
||||
else
|
||||
name = minetest.env:get_node(pointed_thing.above).name
|
||||
local def = minetest.registered_nodes[name]
|
||||
if homedecor_node_is_owned(pointed_thing.above, placer)
|
||||
or (not def.buildable_to) then
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
|
||||
local node=minetest.env:get_node(pointed_thing.under)
|
||||
|
||||
@ -432,6 +441,7 @@ function homedecor_register_fence_with_sign(fencename, fencewithsignname)
|
||||
minetest.pos_to_string(pos)
|
||||
))
|
||||
end
|
||||
if not homedecor_node_is_owned(pos, sender) then return end
|
||||
homedecor_update_sign(pos, fields)
|
||||
end
|
||||
def_sign.on_punch = function(pos, node, puncher, ...)
|
||||
|
Loading…
Reference in New Issue
Block a user