diff --git a/crafting.lua b/crafting.lua index 35da647..9e5bcec 100644 --- a/crafting.lua +++ b/crafting.lua @@ -381,6 +381,7 @@ local function crafting_callback(state) local search_string = state:get("search"):getText() if search_string ~= "" and search_string ~= state.param.survival_search_string then local filtered_list = ui_tools.search_in_list(cache.get_revealed_items(player), search_string, player) + state.param.survival_search_string = search_string state.param.crafting_grouped_items = cache.get_list_grouped(filtered_list) update_group_selection(state, true) end diff --git a/creative.lua b/creative.lua index 6d3fa34..9fba60c 100644 --- a/creative.lua +++ b/creative.lua @@ -115,9 +115,10 @@ local function creative_callback(state) state:onInput(function(state, fields, player) local search_string = state:get("search"):getText() if search_string ~= (state.param.creative_search_string or "") then - local filtered_list = ui_tools.search_in_list(state.param.creative_grouped_items_all, search_string, player) + local filtered_list = ui_tools.search_in_list(state.param.creative_grouped_items_all, search_string) state.param.creative_grouped_items = cache.get_list_grouped(filtered_list) - filtered_list = ui_tools.search_in_list(state.param.creative_grouped_items_material_all, search_string, player) + filtered_list = ui_tools.search_in_list(state.param.creative_grouped_items_material_all, search_string) + state.param.creative_search_string = search_string state.param.creative_grouped_material_items = filtered_list update_group_selection(state, 0) end diff --git a/ui_tools.lua b/ui_tools.lua index d8d1bab..8e4ed6f 100644 --- a/ui_tools.lua +++ b/ui_tools.lua @@ -107,7 +107,7 @@ function ui_tools.search_in_list(list, search_string, playername) end end end - if smart_inventory.doc_items_mod then + if smart_inventory.doc_items_mod and playername then for _, entry in ipairs(filtered_list) do if entry.recipes then local valid_recipes = {}