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:
parent
b85d9bf21e
commit
78354ea87f
@ -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({
|
|
||||||
method = "cooking",
|
|
||||||
width = 1,
|
|
||||||
items = {drop}
|
|
||||||
})
|
|
||||||
|
|
||||||
-- if we have cooked result then add to new list
|
while not stack:is_empty() do
|
||||||
if output
|
|
||||||
and output.item
|
|
||||||
and not output.item:is_empty() then
|
|
||||||
|
|
||||||
table.insert(hot_drops,
|
local output, decremented_input = minetest.get_craft_result({
|
||||||
ItemStack({
|
method = "cooking",
|
||||||
name = output.item:get_name(),
|
width = 1,
|
||||||
count = output.item:to_table().count,
|
items = {stack}
|
||||||
})
|
})
|
||||||
)
|
|
||||||
else -- if not then return normal drops
|
if output.item:is_empty() then
|
||||||
table.insert(hot_drops, stack)
|
|
||||||
|
table.insert_all(hot_drops, decremented_input.items)
|
||||||
|
break
|
||||||
|
else
|
||||||
|
if not output.item:is_empty() then
|
||||||
|
table.insert(hot_drops, output.item)
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert_all(hot_drops, output.replacements)
|
||||||
|
|
||||||
|
stack = decremented_input.items[1] or ItemStack()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user