Don't rebuild creative inv. on same tab (mostly)

This commit is contained in:
Wuzzy 2017-06-02 19:01:12 +02:00
parent 6f1e958758
commit 20dabaa352
1 changed files with 11 additions and 0 deletions

View File

@ -351,39 +351,50 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
local name = player:get_player_name() local name = player:get_player_name()
if fields.blocks then if fields.blocks then
if players[name].page == "blocks" then return end
set_inv("\0blocks",player) set_inv("\0blocks",player)
page = "blocks" page = "blocks"
elseif fields.deco then elseif fields.deco then
if players[name].page == "deco" then return end
set_inv("\0deco",player) set_inv("\0deco",player)
page = "deco" page = "deco"
elseif fields.redstone then elseif fields.redstone then
if players[name].page == "redstone" then return end
set_inv("\0redstone",player) set_inv("\0redstone",player)
page = "redstone" page = "redstone"
elseif fields.rail then elseif fields.rail then
if players[name].page == "rail" then return end
set_inv("\0rail",player) set_inv("\0rail",player)
page = "rail" page = "rail"
elseif fields.misc then elseif fields.misc then
if players[name].page == "misc" then return end
set_inv("\0misc",player) set_inv("\0misc",player)
page = "misc" page = "misc"
elseif fields.nix then elseif fields.nix then
set_inv("\0all",player) set_inv("\0all",player)
page = "nix" page = "nix"
elseif fields.food then elseif fields.food then
if players[name].page == "food" then return end
set_inv("\0food",player) set_inv("\0food",player)
page = "food" page = "food"
elseif fields.tools then elseif fields.tools then
if players[name].page == "tools" then return end
set_inv("\0tools",player) set_inv("\0tools",player)
page = "tools" page = "tools"
elseif fields.combat then elseif fields.combat then
if players[name].page == "combat" then return end
set_inv("\0combat",player) set_inv("\0combat",player)
page = "combat" page = "combat"
elseif fields.brew then elseif fields.brew then
if players[name].page == "brew" then return end
set_inv("\0brew",player) set_inv("\0brew",player)
page = "brew" page = "brew"
elseif fields.matr then elseif fields.matr then
if players[name].page == "matr" then return end
set_inv("\0matr",player) set_inv("\0matr",player)
page = "matr" page = "matr"
elseif fields.inv then elseif fields.inv then
if players[name].page == "inv" then return end
page = "inv" page = "inv"
elseif fields.suche == "" and not fields.creative_next and not fields.creative_prev then elseif fields.suche == "" and not fields.creative_next and not fields.creative_prev then
set_inv("\0all", player) set_inv("\0all", player)