mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-30 18:46:28 -04:00
Replace new infotext with use of function
This commit is contained in:
parent
7477bf4969
commit
1a052753bc
1 changed files with 6 additions and 7 deletions
|
@ -200,7 +200,7 @@ local function furnace_node_timer(pos, elapsed)
|
||||||
if fuel and fuel_totaltime > fuel.time then
|
if fuel and fuel_totaltime > fuel.time then
|
||||||
fuel_totaltime = fuel.time
|
fuel_totaltime = fuel.time
|
||||||
end
|
end
|
||||||
if srclist[1]:is_empty() then
|
if srclist and srclist[1]:is_empty() then
|
||||||
src_time = 0
|
src_time = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -218,10 +218,10 @@ local function furnace_node_timer(pos, elapsed)
|
||||||
item_state = S("@1%", item_percent)
|
item_state = S("@1%", item_percent)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if srclist[1]:is_empty() then
|
if srclist and not srclist[1]:is_empty() then
|
||||||
item_state = S("Empty")
|
|
||||||
else
|
|
||||||
item_state = S("Not cookable")
|
item_state = S("Not cookable")
|
||||||
|
else
|
||||||
|
item_state = S("Empty")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ local function furnace_node_timer(pos, elapsed)
|
||||||
-- make sure timer restarts automatically
|
-- make sure timer restarts automatically
|
||||||
result = true
|
result = true
|
||||||
else
|
else
|
||||||
if not fuellist[1]:is_empty() then
|
if fuellist and not fuellist[1]:is_empty() then
|
||||||
fuel_state = S("@1%", 0)
|
fuel_state = S("@1%", 0)
|
||||||
end
|
end
|
||||||
formspec = default.get_furnace_inactive_formspec()
|
formspec = default.get_furnace_inactive_formspec()
|
||||||
|
@ -291,12 +291,11 @@ minetest.register_node("default:furnace", {
|
||||||
|
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("formspec", default.get_furnace_inactive_formspec())
|
|
||||||
meta:set_string("infotext", 'Furnace inactive\n(Item: Empty; Fuel: Empty)')
|
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
inv:set_size('src', 1)
|
inv:set_size('src', 1)
|
||||||
inv:set_size('fuel', 1)
|
inv:set_size('fuel', 1)
|
||||||
inv:set_size('dst', 4)
|
inv:set_size('dst', 4)
|
||||||
|
furnace_node_timer(pos, 0)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_metadata_inventory_move = function(pos)
|
on_metadata_inventory_move = function(pos)
|
||||||
|
|
Loading…
Add table
Reference in a new issue