Remove infotext from chests and furnaces
This commit is contained in:
parent
1848a7a6d2
commit
3d13afbb27
@ -726,7 +726,6 @@ minetest.register_node("default:chest", {
|
|||||||
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.chest_formspec)
|
meta:set_string("formspec",default.chest_formspec)
|
||||||
meta:set_string("infotext", "Chest")
|
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
inv:set_size("main", 8*4)
|
inv:set_size("main", 8*4)
|
||||||
end,
|
end,
|
||||||
@ -769,12 +768,9 @@ minetest.register_node("default:chest_locked", {
|
|||||||
after_place_node = function(pos, placer)
|
after_place_node = function(pos, placer)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("owner", placer:get_player_name() or "")
|
meta:set_string("owner", placer:get_player_name() or "")
|
||||||
meta:set_string("infotext", "Locked Chest (owned by "..
|
|
||||||
meta:get_string("owner")..")")
|
|
||||||
end,
|
end,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("infotext", "Locked Chest")
|
|
||||||
meta:set_string("owner", "")
|
meta:set_string("owner", "")
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
inv:set_size("main", 8*4)
|
inv:set_size("main", 8*4)
|
||||||
@ -874,7 +870,6 @@ 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.furnace_inactive_formspec)
|
meta:set_string("formspec", default.furnace_inactive_formspec)
|
||||||
meta:set_string("infotext", "Furnace")
|
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
inv:set_size("fuel", 1)
|
inv:set_size("fuel", 1)
|
||||||
inv:set_size("src", 1)
|
inv:set_size("src", 1)
|
||||||
@ -897,9 +892,6 @@ minetest.register_node("default:furnace", {
|
|||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
if listname == "fuel" then
|
if listname == "fuel" then
|
||||||
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
|
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
|
||||||
if inv:is_empty("src") then
|
|
||||||
meta:set_string("infotext","Furnace is empty")
|
|
||||||
end
|
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
@ -916,9 +908,6 @@ minetest.register_node("default:furnace", {
|
|||||||
local stack = inv:get_stack(from_list, from_index)
|
local stack = inv:get_stack(from_list, from_index)
|
||||||
if to_list == "fuel" then
|
if to_list == "fuel" then
|
||||||
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
|
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
|
||||||
if inv:is_empty("src") then
|
|
||||||
meta:set_string("infotext","Furnace is empty")
|
|
||||||
end
|
|
||||||
return count
|
return count
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
@ -946,7 +935,6 @@ minetest.register_node("default:furnace_active", {
|
|||||||
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.furnace_inactive_formspec)
|
meta:set_string("formspec", default.furnace_inactive_formspec)
|
||||||
meta:set_string("infotext", "Furnace");
|
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
inv:set_size("fuel", 1)
|
inv:set_size("fuel", 1)
|
||||||
inv:set_size("src", 1)
|
inv:set_size("src", 1)
|
||||||
@ -969,9 +957,6 @@ minetest.register_node("default:furnace_active", {
|
|||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
if listname == "fuel" then
|
if listname == "fuel" then
|
||||||
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
|
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
|
||||||
if inv:is_empty("src") then
|
|
||||||
meta:set_string("infotext","Furnace is empty")
|
|
||||||
end
|
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
@ -988,9 +973,6 @@ minetest.register_node("default:furnace_active", {
|
|||||||
local stack = inv:get_stack(from_list, from_index)
|
local stack = inv:get_stack(from_list, from_index)
|
||||||
if to_list == "fuel" then
|
if to_list == "fuel" then
|
||||||
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
|
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
|
||||||
if inv:is_empty("src") then
|
|
||||||
meta:set_string("infotext","Furnace is empty")
|
|
||||||
end
|
|
||||||
return count
|
return count
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
@ -1067,7 +1049,6 @@ minetest.register_abm({
|
|||||||
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
|
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
|
||||||
local percent = math.floor(meta:get_float("fuel_time") /
|
local percent = math.floor(meta:get_float("fuel_time") /
|
||||||
meta:get_float("fuel_totaltime") * 100)
|
meta:get_float("fuel_totaltime") * 100)
|
||||||
meta:set_string("infotext","Furnace active: "..percent.."%")
|
|
||||||
hacky_swap_node(pos,"default:furnace_active")
|
hacky_swap_node(pos,"default:furnace_active")
|
||||||
meta:set_string("formspec",default.get_furnace_active_formspec(pos, percent))
|
meta:set_string("formspec",default.get_furnace_active_formspec(pos, percent))
|
||||||
return
|
return
|
||||||
@ -1087,7 +1068,6 @@ minetest.register_abm({
|
|||||||
end
|
end
|
||||||
|
|
||||||
if fuel.time <= 0 then
|
if fuel.time <= 0 then
|
||||||
meta:set_string("infotext","Furnace out of fuel")
|
|
||||||
hacky_swap_node(pos,"default:furnace")
|
hacky_swap_node(pos,"default:furnace")
|
||||||
meta:set_string("formspec", default.furnace_inactive_formspec)
|
meta:set_string("formspec", default.furnace_inactive_formspec)
|
||||||
return
|
return
|
||||||
@ -1095,7 +1075,6 @@ minetest.register_abm({
|
|||||||
|
|
||||||
if cooked.item:is_empty() then
|
if cooked.item:is_empty() then
|
||||||
if was_active then
|
if was_active then
|
||||||
meta:set_string("infotext","Furnace is empty")
|
|
||||||
hacky_swap_node(pos,"default:furnace")
|
hacky_swap_node(pos,"default:furnace")
|
||||||
meta:set_string("formspec", default.furnace_inactive_formspec)
|
meta:set_string("formspec", default.furnace_inactive_formspec)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user