Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tenplus1 authored and paramat committed Jun 14, 2017
1 parent b3f17cd commit 0157175
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion 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")
Expand Down

0 comments on commit 0157175

Please sign in to comment.