mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-09-25 13:50:30 +02:00
Add helper function for recording owner
This commit is contained in:
parent
871bb8301e
commit
633718af81
|
@ -133,6 +133,18 @@ function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky)
|
|||
return nodes
|
||||
end
|
||||
|
||||
function mesecon.mvps_mark_owner(pos, placer)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local owner = placer and placer.get_player_name and placer:get_player_name()
|
||||
if owner and owner ~= "" then
|
||||
meta.set_string("owner", owner)
|
||||
meta.set_string("infotext", "Owned by " .. owner)
|
||||
else
|
||||
meta.set_string("owner", "$unknown") -- to distinguish from older pistons
|
||||
meta.set_string("infotext", "Unowned")
|
||||
end
|
||||
end
|
||||
|
||||
local function prot_deny() return true end
|
||||
local function prot_allow() return false end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user