Update furnace.lua

move any final replacement from "src" to "dst"
This commit is contained in:
tenplus1 2025-08-25 10:43:50 +01:00 committed by GitHub
parent 19bdb67ba4
commit 4979632ded
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -175,6 +175,16 @@ local function furnace_node_timer(pos, elapsed)
if inv:room_for_item("dst", cooked.item) then
inv:add_item("dst", cooked.item)
inv:set_stack("src", 1, aftercooked.items[1])
-- stop any final replacement from clogging "src"
local can_cook = core.get_craft_result({
method = "cooking", width = 1,
items = {aftercooked.items[1]:to_string()}})
if can_cook.time == 0 and can_cook.item:to_string() == ""
and aftercooked.items[1]:to_string() ~= "" then
inv:set_stack("src", 1, "")
add_item_or_drop(inv, pos, aftercooked.items[1])
end
src_time = src_time - cooked.time
update = true
-- add replacement item to dst so they arent lost