Don't erase shulke box contents on dispenser place

This commit is contained in:
Wuzzy 2017-06-12 22:25:21 +02:00
parent d4799b5144
commit 1d91d94ee6

@ -317,12 +317,15 @@ local dispenserdef = {
end end
end end
elseif igroups.head or igroups.shulker_box or iname == "mcl_farming:pumpkin_face" then elseif igroups.shulker_box then
-- Place head, shulker box, or pumpkin as node -- Place shulker box as node
if dropnodedef.buildable_to then if dropnodedef.buildable_to then
minetest.set_node(droppos, {name = iname, param2 = node.param2}) minetest.set_node(droppos, {name = iname, param2 = node.param2})
local imeta = stack:get_metadata()
local iinv_main = minetest.deserialize(imeta)
local ninv = minetest.get_inventory({type="node", pos=droppos})
ninv:set_list("main", iinv_main)
stack:take_item() stack:take_item()
inv:set_stack("main", stack_id, stack)
end end
elseif igroups.spawn_egg then elseif igroups.spawn_egg then