1
0
mirror of https://codeberg.org/tenplus1/mobs_monster.git synced 2025-01-03 14:50:23 +01:00

fix lava_pick outputs (thanks fluxionary)

This commit is contained in:
tenplus1 2022-10-25 14:30:38 +01:00
parent b85d9bf21e
commit 78354ea87f

View File

@ -150,29 +150,32 @@ function minetest.handle_node_drops(pos, drops, digger)
local hot_drops = {} local hot_drops = {}
-- loop through current node drops -- loop through current node drops
for _, drop in pairs(drops) do for _, drop in ipairs(drops) do
-- get cooked output of current drops -- get cooked output of current drops
local stack = ItemStack(drop) local stack = ItemStack(drop)
local output = minetest.get_craft_result({
while not stack:is_empty() do
local output, decremented_input = minetest.get_craft_result({
method = "cooking", method = "cooking",
width = 1, width = 1,
items = {drop} items = {stack}
}) })
-- if we have cooked result then add to new list if output.item:is_empty() then
if output
and output.item
and not output.item:is_empty() then
table.insert(hot_drops, table.insert_all(hot_drops, decremented_input.items)
ItemStack({ break
name = output.item:get_name(), else
count = output.item:to_table().count, if not output.item:is_empty() then
}) table.insert(hot_drops, output.item)
) end
else -- if not then return normal drops
table.insert(hot_drops, stack) table.insert_all(hot_drops, output.replacements)
stack = decremented_input.items[1] or ItemStack()
end
end end
end end