| | |
| | | |
| | | local S = technic.getter |
| | | |
| | | local cable_entry = "^technic_cable_connection_overlay.png" |
| | | |
| | | minetest.register_craft({ |
| | | output = "technic:power_monitor", |
| | | recipe = { |
| | |
| | | |
| | | minetest.register_node("technic:power_monitor",{ |
| | | description = S("Power Monitor"), |
| | | tiles = {"technic_water_mill_top_active.png", "technic_water_mill_top_active.png", |
| | | "technic_water_mill_top_active.png", "technic_water_mill_top_active.png", |
| | | "technic_water_mill_top_active.png", "technic_water_mill_top_active.png"}, |
| | | tiles = { |
| | | "technic_power_monitor_sides.png", |
| | | "technic_power_monitor_sides.png"..cable_entry, |
| | | "technic_power_monitor_sides.png", |
| | | "technic_power_monitor_sides.png", |
| | | "technic_power_monitor_sides.png"..cable_entry, |
| | | "technic_power_monitor_front.png" |
| | | }, |
| | | paramtype2 = "facedir", |
| | | groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1, technic_machine=1}, |
| | | connect_sides = {"bottom"}, |
| | | connect_sides = {"bottom", "back"}, |
| | | sounds = default.node_sound_wood_defaults(), |
| | | on_construct = function(pos) |
| | | local meta = minetest.get_meta(pos) |
| | |
| | | |
| | | minetest.register_abm({ |
| | | nodenames = {"technic:power_monitor"}, |
| | | label = "Power Monitor", |
| | | label = "Machines: run power monitor", |
| | | interval = 1, |
| | | chance = 1, |
| | | action = function(pos, node, active_object_count, active_object_count_wider) |
| | |
| | | local demand = sw_meta:get_int("demand") |
| | | meta:set_string("infotext", |
| | | S("Power Monitor. Supply: @1 Demand: @2", |
| | | technic.pretty_num(supply), technic.pretty_num(demand))) |
| | | technic.EU_string(supply), technic.EU_string(demand))) |
| | | else |
| | | meta:set_string("infotext",S("Power Monitor Has No Network")) |
| | | end |