mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-23 15:20:19 +01:00
Creative: Add 'creative' privilege for survival servers
This adds a 'creative' privilege to survival servers which OPs can bestow on admin or competent builders to give access to the creative inventory.
This commit is contained in:
parent
b3f17cda9f
commit
0157175346
@ -1,9 +1,15 @@
|
|||||||
creative = {}
|
creative = {}
|
||||||
|
|
||||||
|
minetest.register_privilege("creative", {
|
||||||
|
description = "Allow player to use creative inventory",
|
||||||
|
give_to_singleplayer = false
|
||||||
|
})
|
||||||
|
|
||||||
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
|
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
|
||||||
|
|
||||||
function creative.is_enabled_for(name)
|
function creative.is_enabled_for(name)
|
||||||
return creative_mode_cache
|
return creative_mode_cache or
|
||||||
|
minetest.check_player_privs(name, {creative = true})
|
||||||
end
|
end
|
||||||
|
|
||||||
dofile(minetest.get_modpath("creative") .. "/inventory.lua")
|
dofile(minetest.get_modpath("creative") .. "/inventory.lua")
|
||||||
|
Loading…
Reference in New Issue
Block a user