From 65a6a316d081d3951438bbbcfce74c9c65db407a Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 26 May 2020 02:11:19 +0200 Subject: Add minetest.is_creative_enabled --- builtin/common/misc_helpers.lua | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'builtin/common') diff --git a/builtin/common/misc_helpers.lua b/builtin/common/misc_helpers.lua index 1a0c71efd..a88adf96d 100644 --- a/builtin/common/misc_helpers.lua +++ b/builtin/common/misc_helpers.lua @@ -345,18 +345,12 @@ if INIT == "game" then --Wrapper for rotate_and_place() to check for sneak and assume Creative mode --implies infinite stacks when performing a 6d rotation. -------------------------------------------------------------------------------- - local creative_mode_cache = core.settings:get_bool("creative_mode") - local function is_creative(name) - return creative_mode_cache or - core.check_player_privs(name, {creative = true}) - end - core.rotate_node = function(itemstack, placer, pointed_thing) local name = placer and placer:get_player_name() or "" local invert_wall = placer and placer:get_player_control().sneak or false return core.rotate_and_place(itemstack, placer, pointed_thing, - is_creative(name), - {invert_wall = invert_wall}, true) + core.is_creative_enabled(name), + {invert_wall = invert_wall}, true) end end -- cgit v1.2.3