summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authortenplus1 <kinsellaja@yahoo.com>2015-05-27 15:57:19 +0100
committertenplus1 <kinsellaja@yahoo.com>2015-05-27 15:57:19 +0100
commit8fdb475a1eb5d137ebaee57de22562f5a2a081b9 (patch)
tree246a20f70371241376e88b24779e1ff6b24ee613 /init.lua
parente98bc4bd6ed9b246bddbe43a25c0979e87d7385b (diff)
Only owner can remove protectors
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index f2cba68..1b50804 100644
--- a/init.lua
+++ b/init.lua
@@ -214,6 +214,12 @@ minetest.register_node("protector:protect", {
end
minetest.add_entity(pos, "protector:display")
end,
+
+ can_dig = function(pos, player)
+ local meta = minetest.get_meta(pos)
+ local inv = meta:get_inventory()
+ return (meta:get_string("owner") == player:get_player_name())
+ end,
})
minetest.register_craft({
@@ -274,6 +280,12 @@ minetest.register_node("protector:protect2", {
end
minetest.add_entity(pos, "protector:display")
end,
+
+ can_dig = function(pos, player)
+ local meta = minetest.get_meta(pos)
+ local inv = meta:get_inventory()
+ return (meta:get_string("owner") == player:get_player_name())
+ end,
})
minetest.register_craft({