Fix item's being subtracted by itemframes in creative mode

This commit is contained in:
cora 2024-05-16 23:52:12 +02:00 committed by the-real-herowl
parent 01fb91acbf
commit 4f371d44c8

View file

@ -102,12 +102,13 @@ end
mcl_itemframes.update_entity = update_entity
--Node functions
function mcl_itemframes.tpl_node.on_rightclick(pos, node, clicker, pstack, pointed_thing)
function mcl_itemframes.tpl_node.on_rightclick(pos, node, clicker, ostack, pointed_thing)
local name = clicker:get_player_name()
if minetest.is_protected(pos, name) then
minetest.record_protection_violation(pos, name)
return
end
local pstack = ItemStack(ostack)
local itemstack = pstack:take_item()
local inv = minetest.get_meta(pos):get_inventory()
drop_item(pos)
@ -116,6 +117,7 @@ function mcl_itemframes.tpl_node.on_rightclick(pos, node, clicker, pstack, point
if not minetest.is_creative_enabled(clicker:get_player_name()) then
return pstack
end
return ostack
end
mcl_itemframes.tpl_node.on_destruct = remove_entity