summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
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({