From b7e4a1e9b578f881ed5036735ba09dfc7309f1cb Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 10 Jul 2020 18:07:21 +0200 Subject: [PATCH] Fix creative handling for itemframe --- mods/ITEMS/mcl_itemframes/init.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_itemframes/init.lua b/mods/ITEMS/mcl_itemframes/init.lua index 8be81bac3..d1431d83c 100644 --- a/mods/ITEMS/mcl_itemframes/init.lua +++ b/mods/ITEMS/mcl_itemframes/init.lua @@ -87,8 +87,12 @@ local update_item_entity = function(pos, node, param2) end end -local drop_item = function(pos, node, meta) - if node.name == "mcl_itemframes:item_frame" and not minetest.is_creative_enabled("") then +local drop_item = function(pos, node, meta, clicker) + local cname = "" + if clicker and clicker:is_player() then + cname = clicker:get_player_name() + end + if node.name == "mcl_itemframes:item_frame" and not minetest.is_creative_enabled(cname) then local inv = meta:get_inventory() local item = inv:get_stack("main", 1) if not item:is_empty() then @@ -132,7 +136,7 @@ minetest.register_node("mcl_itemframes:item_frame",{ return end local meta = minetest.get_meta(pos) - drop_item(pos, node, meta) + drop_item(pos, node, meta, clicker) local inv = meta:get_inventory() if itemstack:is_empty() then remove_item_entity(pos, node)