add support for unified inventory

This commit is contained in:
kakalak-lumberJack 2018-02-22 21:55:37 -05:00
parent 5d5c7e9c38
commit 57a351c465
3 changed files with 14 additions and 5 deletions

View File

@ -1,2 +1,4 @@
areas
creative
creative
sfinv?
unified_inventory?

View File

@ -109,8 +109,11 @@ minetest.register_globalstep(function(dtime)
if not minetest.check_player_privs(pname, {creative = true}) then
privs.creative = true
minetest.set_player_privs(pname, privs)
local context = {page = sfinv.get_homepage_name(player)}--minetest.get_inventory{{type="detached", name="creative_"..pname}}--{page = sfinv.pages["creative_"..pname]}
sfinv.set_player_inventory_formspec(player, context)
if not minetest.get_modpath("unified_inventory") then
local context = {page = sfinv.get_homepage_name(player)}--minetest.get_inventory{{type="detached", name="creative_"..pname}}--{page = sfinv.pages["creative_"..pname]}
sfinv.set_player_inventory_formspec(player, context)
end
--unified_inventory.get_formspec(player, page)
local invlist = inv:get_list("main")
inv:set_list("saved", invlist)
local list = ""
@ -129,8 +132,11 @@ minetest.register_globalstep(function(dtime)
if saved ~= nil then
inv:set_list("main", saved)
end
local context = {page = sfinv.get_homepage_name(player)}
sfinv.set_player_inventory_formspec(player, context)
if not minetest.get_modpath("unified_inventory") then
local context = {page = sfinv.get_homepage_name(player)}
sfinv.set_player_inventory_formspec(player, context)
end
--unified_inventory.get_formspec(player, page)
minetest.chat_send_player(pname, "You have left creative area.")
end
end

1
creative_areas/mod.conf Normal file
View File

@ -0,0 +1 @@
name = creative_areas