summaryrefslogtreecommitdiff
path: root/unified_inventory
diff options
context:
space:
mode:
authorRealBadAngel <mk@realbadangel.pl>2013-05-25 22:39:25 +0200
committerRealBadAngel <mk@realbadangel.pl>2013-05-25 22:39:25 +0200
commit630db84ad13682eadc0035c251febfa07353a969 (patch)
treefd0cd15d73cd605bc80a3099165ec6e1af33be3a /unified_inventory
parent64207baa4563db90fa80ed23f3b8f41f96f0260d (diff)
bugfix
Diffstat (limited to 'unified_inventory')
-rw-r--r--unified_inventory/api.lua17
1 files changed, 5 insertions, 12 deletions
diff --git a/unified_inventory/api.lua b/unified_inventory/api.lua
index ab55903..02c08e9 100644
--- a/unified_inventory/api.lua
+++ b/unified_inventory/api.lua
@@ -58,7 +58,7 @@ minetest.register_on_joinplayer(function(player)
unified_inventory.alternate[player_name] = 1
unified_inventory.current_item[player_name] =nil
unified_inventory.set_inventory_formspec(player,unified_inventory.get_formspec(player, unified_inventory.default))
-
+
--crafting guide inventories
local inv = minetest.create_detached_inventory(player:get_player_name().."craftrecipe",{
allow_put = function(inv, listname, index, stack, player)
@@ -75,8 +75,8 @@ local inv = minetest.create_detached_inventory(player:get_player_name().."craftr
return 0
end,
})
- inv:set_size("output", 1)
- inv:set_size("build", 3*3)
+inv:set_size("output", 1)
+inv:set_size("build", 3*3)
-- refill slot
unified_inventory.refill = minetest.create_detached_inventory(player_name.."refill", {
@@ -93,7 +93,6 @@ unified_inventory.refill = minetest.create_detached_inventory(player_name.."refi
end,
})
unified_inventory.refill:set_size("main", 1)
-end)
-- trash slot
unified_inventory.trash = minetest.create_detached_inventory("trash", {
@@ -111,24 +110,18 @@ unified_inventory.trash = minetest.create_detached_inventory("trash", {
end,
})
unified_inventory.trash:set_size("main", 1)
+end)
-- set_inventory_formspec
unified_inventory.set_inventory_formspec = function(player,formspec)
if player then
- if minetest.setting_getbool("creative_mode") then
- -- if creative mode is on then wait a bit
- minetest.after(0.01,function()
- player:set_inventory_formspec(formspec)
- end)
- else
player:set_inventory_formspec(formspec)
- end
end
end
-- get_formspec
unified_inventory.get_formspec = function(player,page)
- if player==nil then return "" end
+ if player==nil then return "" end
local player_name = player:get_player_name()
unified_inventory.current_page[player_name]=page