mirror of
https://notabug.org/TenPlus1/protector.git
synced 2025-01-21 13:31:43 +01:00
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 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
|
||||
|
||||
@ -14,4 +14,5 @@ Released under WTFPL
|
||||
0.6 - Added Protected Doors (wood and steel) and Protected Chest
|
||||
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.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
|
||||
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({
|
||||
|
Loading…
Reference in New Issue
Block a user