mirror of
https://github.com/Dragonop/claycrafter.git
synced 2024-11-22 15:23:48 +01:00
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.
This commit is contained in:
parent
fea2299053
commit
4a8a178800
@ -230,7 +230,7 @@ minetest.register_abm({
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- Furnace ran out of fuel
|
-- 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
|
-- We need to get new fuel
|
||||||
local fueltime = minetest.get_item_group(inv:get_stack("fuel", 1):get_name(), "h2o")
|
local fueltime = minetest.get_item_group(inv:get_stack("fuel", 1):get_name(), "h2o")
|
||||||
|
|
||||||
@ -241,16 +241,13 @@ minetest.register_abm({
|
|||||||
src_time = 0
|
src_time = 0
|
||||||
else
|
else
|
||||||
-- Take fuel from fuel list
|
-- Take fuel from fuel list
|
||||||
|
if inv:room_for_item("vessels", ItemStack({name = "vessels:drinking_glass"}))
|
||||||
if inv:room_for_item("dst", ItemStack({name = "default:clay", count = 4}))
|
|
||||||
and inv:room_for_item("vessels", ItemStack({name = "vessels:drinking_glass"}))
|
|
||||||
then
|
then
|
||||||
inv:remove_item("fuel", inv:get_stack("fuel", 1):get_name())
|
inv:remove_item("fuel", inv:get_stack("fuel", 1):get_name())
|
||||||
inv:add_item("vessels", {name = "vessels:drinking_glass"})
|
inv:add_item("vessels", {name = "vessels:drinking_glass"})
|
||||||
else
|
else
|
||||||
swap_node(pos, "claycrafter:claycrafter_active")
|
swap_node(pos, "claycrafter:claycrafter_active")
|
||||||
end
|
end
|
||||||
|
|
||||||
fuel_totaltime = fueltime
|
fuel_totaltime = fueltime
|
||||||
fuel_time = 0
|
fuel_time = 0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user