From 452cd2655816b54ef8750d8d0a68a16994223bec Mon Sep 17 00:00:00 2001 From: AFCMS Date: Sat, 10 Sep 2022 11:05:59 +0200 Subject: [PATCH] Reenable creative formspec armor update --- mods/HUD/mcl_inventory/init.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mods/HUD/mcl_inventory/init.lua b/mods/HUD/mcl_inventory/init.lua index ca019fae8..2f954c070 100644 --- a/mods/HUD/mcl_inventory/init.lua +++ b/mods/HUD/mcl_inventory/init.lua @@ -431,15 +431,16 @@ minetest.register_on_joinplayer(function(player) end) ---@param player ObjectRef -function mcl_inventory.update_inventory(player) +---@param armor_change_only? boolean +function mcl_inventory.update_inventory(player, armor_change_only) local player_gamemode = mcl_gamemode.get_gamemode(player) if player_gamemode == "creative" then - --if armor_change_only then - -- Stay on survival inventory plage if only the armor has been changed - -- mcl_inventory.set_creative_formspec(player, 0, 0, nil, nil, "inv") - --else - mcl_inventory.set_creative_formspec(player, 0, 1) - --end + if armor_change_only then + -- Stay on survival inventory plage if only the armor has been changed + mcl_inventory.set_creative_formspec(player, 0, 0, nil, nil, "inv") + else + mcl_inventory.set_creative_formspec(player, 0, 1) + end elseif player_gamemode == "survival" then player:set_inventory_formspec(mcl_inventory.build_survival_formspec(player)) end