From c3472a3580605df4bba8655b5e497a7667fe4171 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Thu, 14 Jan 2021 14:53:32 +0100 Subject: [PATCH] Cleanup progressive --- init.lua | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/init.lua b/init.lua index 86477b6..39f4b6f 100644 --- a/init.lua +++ b/init.lua @@ -1983,7 +1983,7 @@ local function make_fs(player, data) get_item_list(fs, data, full_height) end - if not is_creative and data.query_item then + if data.query_item then get_panels(player, fs, data) end @@ -2294,13 +2294,6 @@ local function init_data(player, name) if data.fs_version < MIN_FORMSPEC_VERSION then return end - if progressive_mode then - data.inv_items = {} - local items = get_filtered_items(player, data) - data.items_raw = items - search(data) - end - after(0, set_fs, player) end @@ -2676,12 +2669,16 @@ if progressive_mode then on_joinplayer(function(player) local name = player:get_player_name() - local data = pdata[name] local meta = player:get_meta() + local data = pdata[name] data.inv_items = dslz(meta:get_string "inv_items") or {} data.known_recipes = dslz(meta:get_string "known_recipes") or 0 + local items = get_filtered_items(player, data) + data.items_raw = items + search(data) + if singleplayer then init_hud(player, data) end