From fdaaf0ec4910c5c103e3c3c5654219eeb2d2296e Mon Sep 17 00:00:00 2001 From: NO11 Date: Sat, 13 Nov 2021 18:56:52 +0000 Subject: [PATCH] Use on_joinplayer instead of on_newplayer --- mods/HUD/mcl_inventory/creative.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mods/HUD/mcl_inventory/creative.lua b/mods/HUD/mcl_inventory/creative.lua index a3314ec0ab..d2dedd5566 100644 --- a/mods/HUD/mcl_inventory/creative.lua +++ b/mods/HUD/mcl_inventory/creative.lua @@ -291,15 +291,17 @@ filtername["inv"] = S("Survival Inventory") end]] local function get_stack_size(player) - return player:get_meta():get_int("switch_stack") + return player:get_meta():get_int("mcl_inventory:switch_stack") end local function set_stack_size(player, n) - player:get_meta():set_int("switch_stack", n) + player:get_meta():set_int("mcl_inventory:switch_stack", n) end -minetest.register_on_newplayer(function (player) - set_stack_size(player, 64) +minetest.register_on_joinplayer(function (player) + if get_stack_size(player) == 0 then + set_stack_size(player, 64) + end end) function mcl_inventory.set_creative_formspec(player, start_i, pagenum, inv_size, show, page, filter)