infotext.lua 510 B

123456789101112131415
  1. local has_technic = minetest.get_modpath("technic")
  2. jumpdrive.update_infotext = function(meta, pos)
  3. local store = meta:get_int("powerstorage")
  4. local max_store = meta:get_int("max_powerstorage")
  5. if has_technic then
  6. local eu_input = meta:get_int("HV_EU_input")
  7. local demand = meta:get_int("HV_EU_demand")
  8. meta:set_string("infotext", "Power: " .. eu_input .. "/" .. demand .. " Store: " .. store .. "/" .. max_store)
  9. else
  10. meta:set_string("infotext", "Store: " .. store .. "/" .. max_store)
  11. end
  12. end