Only owner can remove protectors
This commit is contained in:
parent
e98bc4bd6e
commit
8fdb475a1e
|
@ -1,6 +1,6 @@
|
||||||
Protector Redo mod [protect]
|
Protector Redo mod [protect]
|
||||||
|
|
||||||
Protector redo mod for minetest is based on glomie's mod, remade by Zeg9 and reworked by TenPlus1 to support minetest 0.4.9 and include protected doors and chests
|
Protector redo mod for minetest is based on glomie's mod, remade by Zeg9 and reworked by TenPlus1.
|
||||||
|
|
||||||
https://forum.minetest.net/viewtopic.php?f=11&t=9376
|
https://forum.minetest.net/viewtopic.php?f=11&t=9376
|
||||||
|
|
||||||
|
@ -15,3 +15,4 @@ Released under WTFPL
|
||||||
0.7 - Protected Chests now have "To Chest" and "To Inventory" buttons to copy contents across, also chests can be named
|
0.7 - Protected Chests now have "To Chest" and "To Inventory" buttons to copy contents across, also chests can be named
|
||||||
0.8 - Updated to work with Minetest 0.4.12, simplified textures
|
0.8 - Updated to work with Minetest 0.4.12, simplified textures
|
||||||
0.9 - Tweaked code
|
0.9 - Tweaked code
|
||||||
|
1.0 - Only owner can remove protector
|
12
init.lua
12
init.lua
|
@ -214,6 +214,12 @@ minetest.register_node("protector:protect", {
|
||||||
end
|
end
|
||||||
minetest.add_entity(pos, "protector:display")
|
minetest.add_entity(pos, "protector:display")
|
||||||
end,
|
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({
|
minetest.register_craft({
|
||||||
|
@ -274,6 +280,12 @@ minetest.register_node("protector:protect2", {
|
||||||
end
|
end
|
||||||
minetest.add_entity(pos, "protector:display")
|
minetest.add_entity(pos, "protector:display")
|
||||||
end,
|
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({
|
minetest.register_craft({
|
||||||
|
|
Loading…
Reference in New Issue