Updated to work with 'creative' priv
This commit is contained in:
parent
0b6241fd7e
commit
074adb0a0f
13
init.lua
13
init.lua
@ -6,7 +6,7 @@ Copyright (c) 2012 cornernote, Brett O'Donnell <cornernote@gmail.com>
|
|||||||
Source Code: https://github.com/cornernote/minetest-inventory_plus
|
Source Code: https://github.com/cornernote/minetest-inventory_plus
|
||||||
License: BSD-3-Clause https://raw.github.com/cornernote/minetest-inventory_plus/master/LICENSE
|
License: BSD-3-Clause https://raw.github.com/cornernote/minetest-inventory_plus/master/LICENSE
|
||||||
|
|
||||||
Edited by TenPlus1 (23rd March 2016)
|
Edited by TenPlus1 (19th October 2016)
|
||||||
|
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
@ -47,15 +47,15 @@ inventory_plus.set_inventory_formspec = function(player, formspec)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.setting_getbool("creative_mode") then
|
-- if minetest.setting_getbool("creative_mode") then
|
||||||
|
|
||||||
-- if creative mode is on then wait a bit
|
-- if creative mode is on then wait a bit
|
||||||
minetest.after(0.01,function()
|
minetest.after(0.01,function()
|
||||||
player:set_inventory_formspec(formspec)
|
player:set_inventory_formspec(formspec)
|
||||||
end)
|
end)
|
||||||
else
|
-- else
|
||||||
player:set_inventory_formspec(formspec)
|
-- player:set_inventory_formspec(formspec)
|
||||||
end
|
-- end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- create detached inventory for trashcan
|
-- create detached inventory for trashcan
|
||||||
@ -135,7 +135,8 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
|
|
||||||
inventory_plus.register_button(player,"craft", "Craft")
|
inventory_plus.register_button(player,"craft", "Craft")
|
||||||
|
|
||||||
if minetest.setting_getbool("creative_mode") then
|
if minetest.setting_getbool("creative_mode")
|
||||||
|
or minetest.check_player_privs(player:get_player_name(), {creative = true}) then
|
||||||
inventory_plus.register_button(player, "creative_prev", "Creative")
|
inventory_plus.register_button(player, "creative_prev", "Creative")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user