forked from VoxeLibre/VoxeLibre
Don't delay setting inventory stuff
This commit is contained in:
parent
acc04d796d
commit
7fbe2f98ce
|
@ -221,9 +221,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
end
|
end
|
||||||
if fields.suche ~= nil and fields.suche ~= "" then
|
if fields.suche ~= nil and fields.suche ~= "" then
|
||||||
set_inv(string.lower(fields.suche))
|
set_inv(string.lower(fields.suche))
|
||||||
minetest.after(0.5, function()
|
|
||||||
minetest.show_formspec(player:get_player_name(), "detached:creative", player:get_inventory_formspec())
|
minetest.show_formspec(player:get_player_name(), "detached:creative", player:get_inventory_formspec())
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if fields.build then
|
if fields.build then
|
||||||
|
|
|
@ -54,10 +54,8 @@ end
|
||||||
|
|
||||||
local function set_inventory(player)
|
local function set_inventory(player)
|
||||||
if minetest.setting_getbool("creative_mode") then
|
if minetest.setting_getbool("creative_mode") then
|
||||||
minetest.after(0.5,function()
|
|
||||||
crafting.set_creative_formspec(player, 0, 1)
|
crafting.set_creative_formspec(player, 0, 1)
|
||||||
return
|
return
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
player:get_inventory():set_width("craft", 2)
|
player:get_inventory():set_width("craft", 2)
|
||||||
player:get_inventory():set_size("craft", 4)
|
player:get_inventory():set_size("craft", 4)
|
||||||
|
@ -148,11 +146,8 @@ minetest.register_on_joinplayer(function(player)
|
||||||
player:get_inventory():set_size("main", 36)
|
player:get_inventory():set_size("main", 36)
|
||||||
|
|
||||||
--set hotbar size
|
--set hotbar size
|
||||||
if player.hud_set_hotbar_itemcount then
|
player:hud_set_hotbar_itemcount(9)
|
||||||
minetest.after(0.5, player.hud_set_hotbar_itemcount, player, 9)
|
|
||||||
end
|
|
||||||
--add hotbar images
|
--add hotbar images
|
||||||
minetest.after(0.5,function()
|
|
||||||
player:hud_set_hotbar_image("crafting_hotbar.png")
|
player:hud_set_hotbar_image("crafting_hotbar.png")
|
||||||
player:hud_set_hotbar_selected_image("crafting_hotbar_selected.png")
|
player:hud_set_hotbar_selected_image("crafting_hotbar_selected.png")
|
||||||
|
|
||||||
|
@ -165,7 +160,6 @@ minetest.register_on_joinplayer(function(player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
|
||||||
|
|
||||||
minetest.register_node("crafting:workbench", {
|
minetest.register_node("crafting:workbench", {
|
||||||
description = "Crafting Table",
|
description = "Crafting Table",
|
||||||
|
|
Loading…
Reference in New Issue