Skip to content

Commit

Permalink
Prevent blocking of fuel inventory by fuel replacement (#2895)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfence committed Oct 23, 2021
1 parent 1309953 commit 02ec133
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mods/default/furnace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,15 @@ local function furnace_node_timer(pos, elapsed)
fuel_totaltime = 0
src_time = 0
else
-- Take fuel from fuel list
inv:set_stack("fuel", 1, afterfuel.items[1])
-- prevent blocking of fuel inventory (for automatization mods)
local is_fuel = minetest.get_craft_result({method = "fuel", width = 1, items = {afterfuel.items[1]:to_string()}})
if is_fuel.time == 0 then
table.insert(fuel.replacements, afterfuel.items[1])
inv:set_stack("fuel", 1, "")
else
-- Take fuel from fuel list
inv:set_stack("fuel", 1, afterfuel.items[1])
end
-- Put replacements in dst list or drop them on the furnace.
local replacements = fuel.replacements
if replacements[1] then
Expand Down

0 comments on commit 02ec133

Please sign in to comment.