mirror of
https://github.com/kakalak-lumberJack/creative_areas.git
synced 2024-12-23 01:10:33 +01:00
add support for unified inventory
This commit is contained in:
parent
5d5c7e9c38
commit
57a351c465
@ -1,2 +1,4 @@
|
||||
areas
|
||||
creative
|
||||
creative
|
||||
sfinv?
|
||||
unified_inventory?
|
@ -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
1
creative_areas/mod.conf
Normal file
@ -0,0 +1 @@
|
||||
name = creative_areas
|
Loading…
Reference in New Issue
Block a user