From 02ec1333923bd2d8a2bada916a76082c1a04652c Mon Sep 17 00:00:00 2001 From: sfence Date: Sat, 23 Oct 2021 14:37:51 +0200 Subject: [PATCH] Prevent blocking of fuel inventory by fuel replacement (#2895) --- mods/default/furnace.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mods/default/furnace.lua b/mods/default/furnace.lua index d5703cd6..b164b8a0 100644 --- a/mods/default/furnace.lua +++ b/mods/default/furnace.lua @@ -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