diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index d1c502fcef..4b10cdac74 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -245,16 +245,16 @@ function minetest.handle_node_drops(pos, drops, digger) end for _,item in ipairs(drops) do - local count, name + local count if type(item) == "string" then - count = 1 - name = item + count = ItemStack(item):get_count() else count = item:get_count() - name = item:get_name() end + local drop_item = ItemStack(item) + drop_item:set_count(1) for i=1,count do - local obj = core.add_item(pos, name) + local obj = core.add_item(pos, drop_item) if obj ~= nil then local x = math.random(1, 5) if math.random(1,2) == 1 then diff --git a/mods/HUD/mcl_inventory/creative.lua b/mods/HUD/mcl_inventory/creative.lua index 7125dcb653..dd5d0bd876 100644 --- a/mods/HUD/mcl_inventory/creative.lua +++ b/mods/HUD/mcl_inventory/creative.lua @@ -555,8 +555,7 @@ if minetest.settings:get_bool("creative_mode") then local inv = digger:get_inventory() if inv then for _,item in ipairs(drops) do - item = ItemStack(item):get_name() - if not inv:contains_item("main", item) then + if not inv:contains_item("main", item, true) then inv:add_item("main", item) end end