From abfd913862109543c53e61accaba656e557332d8 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 3 Jun 2020 15:58:34 +0200 Subject: [PATCH] Replace deprecated get/set_attribute --- init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 162f12c..1a17a53 100644 --- a/init.lua +++ b/init.lua @@ -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