diff --git a/files/3d_armor/init.lua b/files/3d_armor/init.lua index 364687a..852a8e1 100644 --- a/files/3d_armor/init.lua +++ b/files/3d_armor/init.lua @@ -9,12 +9,7 @@ local function handle_inventory(player) if player and player:is_player() then armor:save_armor_inventory(player) armor:set_player_armor(player) - if creative and creative.is_enabled_for and - creative.is_enabled_for(player) then - local set = set_creative_inventory and set_creative_inventory(player) - else - local set = set_survival_inventory and set_survival_inventory(player) - end + sfinv.set_player_inventory_formspec(player) end end diff --git a/files/sfinv/api.lua b/files/sfinv/api.lua index 93c2e54..8b9e176 100644 --- a/files/sfinv/api.lua +++ b/files/sfinv/api.lua @@ -13,7 +13,9 @@ function sfinv.register_page(name, def) sfinv.pages[name] = def def.name = name - table.insert(sfinv.pages_unordered, def) + + local unpages = sfinv.pages_unordered + unpages[#unpages+1] = def end function sfinv.override_page(name, def) @@ -37,9 +39,9 @@ end end]] local theme_inv = [[ - list[current_player;main;0.01,4.51;9,3;9] - list[current_player;main;0.01,7.74;9,1;] - ]] + list[current_player;main;0.01,4.51;9,3;9] + list[current_player;main;0.01,7.74;9,1;] +]] function sfinv.make_formspec(_, _, content, show_inv, size) local tmp = { @@ -173,11 +175,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) return false end - if fields.quit then - sfinv.reset_context(player) - return false - end - -- Get Context local name = player:get_player_name() local context = sfinv.contexts[name] diff --git a/files/sfinv/init.lua b/files/sfinv/init.lua index 6f72a8f..0dc5797 100644 --- a/files/sfinv/init.lua +++ b/files/sfinv/init.lua @@ -2,6 +2,6 @@ dofile(minetest.get_modpath("sfinv") .. "/api.lua") sfinv.register_page("sfinv:inventory", { get = function(_, player, context) - return sfinv.make_formspec(player, context, [[ ]], true) + return sfinv.make_formspec(player, context, "") end -}) \ No newline at end of file +})