From 716404cdbd2223501d90854c8c8f3d0b5fcb5730 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 9 Mar 2017 19:15:09 +0100 Subject: [PATCH] Fix armor page being the default in creative --- mods/HUD/mcl_inventory/init.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mods/HUD/mcl_inventory/init.lua b/mods/HUD/mcl_inventory/init.lua index 5c30c94e57..11a2a86ad3 100644 --- a/mods/HUD/mcl_inventory/init.lua +++ b/mods/HUD/mcl_inventory/init.lua @@ -148,7 +148,6 @@ end) minetest.register_on_joinplayer(function(player) --init inventory - set_inventory(player) player:get_inventory():set_width("main", 9) player:get_inventory():set_size("main", 36) @@ -159,14 +158,20 @@ minetest.register_on_joinplayer(function(player) player:hud_set_hotbar_selected_image("crafting_hotbar_selected.png") if show_armor then - local armor_orginal = armor.set_player_armor + local set_player_armor_original = armor.set_player_armor + local update_inventory_original = armor.update_inventory armor.set_player_armor = function(self, player) - armor_orginal(self, player) + set_player_armor_original(self, player) update_armor(player) + end + armor.update_inventory = function(self, player) + update_inventory_original(self, player) set_inventory(player, true) end end + set_inventory(player) + --[[ Make sure the crafting grid is empty. Why? Because the player might have items remaining in the crafting grid from the previous join; this is likely when the server has been shutdown and the server didn't clean up the player