Replace deprecated get/set_attribute

This commit is contained in:
Wuzzy 2020-06-03 15:58:34 +02:00
parent 01a3a970d2
commit abfd913862
1 changed files with 4 additions and 2 deletions

View File

@ -142,7 +142,8 @@ function schemedit.show_formspec(pos, player, tab, show, ...)
-- Update player attribute
if forms[tab].cache_name ~= false then
player:set_attribute("schemedit:tab", tab)
local pmeta = player:get_meta()
pmeta:set_string("schemedit:tab", tab)
end
else
minetest.close_formspec(pname, "schemedit:"..tab)
@ -1064,7 +1065,8 @@ S("With a schematic node probability tool, you can set a probability for each no
if meta:get_string("owner") == name or
minetest.check_player_privs(player, "schematic_override") == true then
-- Get player attribute
local tab = player:get_attribute("schemedit:tab")
local pmeta = player:get_meta()
local tab = pmeta:get_string("schemedit:tab")
if not forms[tab] or not tab then
tab = "main"
end