From 4a8a178800fbdc98a30e7e61fd09d040dae810e3 Mon Sep 17 00:00:00 2001 From: Joaquin Villalba Date: Fri, 13 Nov 2020 01:30:44 -0300 Subject: [PATCH] Fix bug where claycrafter won't turn off Fixed a bug where the Claycrafter would remain in its active state even if the output inv was full. This didn't waste or create any resources (only light and kept the block animated), it was purely cosmetic. Fixes issue #9, I guess. --- claycrafter.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/claycrafter.lua b/claycrafter.lua index c3255e2..25ec205 100644 --- a/claycrafter.lua +++ b/claycrafter.lua @@ -230,7 +230,7 @@ minetest.register_abm({ end else -- Furnace ran out of fuel - if cookable then + if cookable and inv:room_for_item("dst", ItemStack({name = "default:clay", count = 4})) then -- We need to get new fuel local fueltime = minetest.get_item_group(inv:get_stack("fuel", 1):get_name(), "h2o") @@ -241,16 +241,13 @@ minetest.register_abm({ src_time = 0 else -- Take fuel from fuel list - - if inv:room_for_item("dst", ItemStack({name = "default:clay", count = 4})) - and inv:room_for_item("vessels", ItemStack({name = "vessels:drinking_glass"})) + if inv:room_for_item("vessels", ItemStack({name = "vessels:drinking_glass"})) then inv:remove_item("fuel", inv:get_stack("fuel", 1):get_name()) inv:add_item("vessels", {name = "vessels:drinking_glass"}) else swap_node(pos, "claycrafter:claycrafter_active") end - fuel_totaltime = fueltime fuel_time = 0