From: tenplus1 Date: Wed, 1 Feb 2017 19:07:30 +0000 (+0000) Subject: Creative: Add 'creative' privilege for survival servers X-Git-Tag: 5.0.0~227 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0157175346f9af8cf9ea5ffeb5f3d91fa474d044;p=oweals%2Fminetest_game.git 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. --- diff --git a/mods/creative/init.lua b/mods/creative/init.lua index 51d6f792..7b842eda 100644 --- a/mods/creative/init.lua +++ b/mods/creative/init.lua @@ -1,9 +1,15 @@ 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") function creative.is_enabled_for(name) - return creative_mode_cache + return creative_mode_cache or + minetest.check_player_privs(name, {creative = true}) end dofile(minetest.get_modpath("creative") .. "/inventory.lua")