1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-23 08:20:21 +01:00

Merge pull request #19 from kaeza/master

Various fixes and additions
This commit is contained in:
VanessaE 2013-05-20 18:11:06 -07:00
commit 5fe3519aab
2 changed files with 19 additions and 5 deletions

View File

@ -49,6 +49,10 @@ function homedecor_node_is_owned(pos, placer)
if not isprotect(5, pos, placer) then if not isprotect(5, pos, placer) then
ownername = S("someone") ownername = S("someone")
end 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 end
if ownername ~= false then if ownername ~= false then

View File

@ -115,11 +115,20 @@ 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] 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) if homedecor_node_is_owned(pointed_thing.above, placer)
or (not def.buildable_to) then or (not def.buildable_to) then
return itemstack return itemstack
end end
end
local node=minetest.env:get_node(pointed_thing.under) 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) minetest.pos_to_string(pos)
)) ))
end end
if not homedecor_node_is_owned(pos, sender) then return end
homedecor_update_sign(pos, fields) homedecor_update_sign(pos, fields)
end end
def_sign.on_punch = function(pos, node, puncher, ...) def_sign.on_punch = function(pos, node, puncher, ...)