From bd38827f60cb063366ddebfb4454b6cee089bfcb Mon Sep 17 00:00:00 2001 From: CyberMango Date: Fri, 16 Dec 2022 16:32:44 +0200 Subject: [PATCH] Fixes #2976 Now the inventory view on creative is no longer set to the survival inventory upon taking damage. Also the initial inventory view when openning a world in creative is at the search page, not the survival inventory page. mcl_inventory/init.lua no longer wraps mcl_armor.update_player to also update the inventory view. This visual update happens anyways since it is registered to happen on a visual change with mcl_player.register_on_visual_change . This also fixes a small visual bug that, on creative mode, if you would equip/unequip an armor piece, the image of the player would be updated twice. --- mods/HUD/mcl_inventory/creative.lua | 1 + mods/HUD/mcl_inventory/init.lua | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/mods/HUD/mcl_inventory/creative.lua b/mods/HUD/mcl_inventory/creative.lua index 517622333f..a9a1d6dd9d 100644 --- a/mods/HUD/mcl_inventory/creative.lua +++ b/mods/HUD/mcl_inventory/creative.lua @@ -699,6 +699,7 @@ minetest.register_on_joinplayer(function(player) players[name].start_i = 0 end init(player) + -- Setup initial creative inventory to the "nix" page. mcl_inventory.set_creative_formspec(player, 0, 1, nil, false, "nix", "") end) diff --git a/mods/HUD/mcl_inventory/init.lua b/mods/HUD/mcl_inventory/init.lua index 4f50a3ef5a..9f54511a03 100644 --- a/mods/HUD/mcl_inventory/init.lua +++ b/mods/HUD/mcl_inventory/init.lua @@ -169,12 +169,6 @@ minetest.register_on_joinplayer(function(player) player:hud_set_hotbar_image("mcl_inventory_hotbar.png") player:hud_set_hotbar_selected_image("mcl_inventory_hotbar_selected.png") - local old_update_player = mcl_armor.update_player - function mcl_armor.update_player(player, info) - old_update_player(player, info) - set_inventory(player, true) - end - -- In Creative Mode, the initial inventory setup is handled in creative.lua if not minetest.is_creative_enabled(player:get_player_name()) then set_inventory(player)