From e86955afae515fcb150f98ad4bc86d0aea91d6c7 Mon Sep 17 00:00:00 2001 From: paramat Date: Tue, 31 Jan 2017 11:41:50 +0000 Subject: [PATCH] Creative: Cache creative mode setting --- mods/creative/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/creative/init.lua b/mods/creative/init.lua index cd9e2b4..7471e60 100644 --- a/mods/creative/init.lua +++ b/mods/creative/init.lua @@ -1,7 +1,9 @@ creative = {} +local creative_mode_cache = minetest.setting_getbool("creative_mode") + function creative.is_enabled_for(name) - return minetest.setting_getbool("creative_mode") + return creative_mode_cache end dofile(minetest.get_modpath("creative") .. "/inventory.lua")