diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2017-04-12 21:05:32 -0400 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2017-04-12 21:05:32 -0400 |
commit | d33a3f4f29a1c56a139e79b4e771c4221e0de954 (patch) | |
tree | f0f515ca7de904742c25c791dfb92855623895d8 /technic/machines/register/battery_box.lua | |
parent | 1105326dc162c7fd5079a55de32fe3c2ad19415a (diff) | |
download | dreambuilder_modpack-d33a3f4f29a1c56a139e79b4e771c4221e0de954.tar dreambuilder_modpack-d33a3f4f29a1c56a139e79b4e771c4221e0de954.tar.gz dreambuilder_modpack-d33a3f4f29a1c56a139e79b4e771c4221e0de954.tar.bz2 dreambuilder_modpack-d33a3f4f29a1c56a139e79b4e771c4221e0de954.tar.xz dreambuilder_modpack-d33a3f4f29a1c56a139e79b4e771c4221e0de954.zip |
update pipeworks and technic
Diffstat (limited to 'technic/machines/register/battery_box.lua')
-rw-r--r-- | technic/machines/register/battery_box.lua | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/technic/machines/register/battery_box.lua b/technic/machines/register/battery_box.lua index 7238d6d..5b298a7 100644 --- a/technic/machines/register/battery_box.lua +++ b/technic/machines/register/battery_box.lua @@ -3,6 +3,7 @@ local digilines_path = minetest.get_modpath("digilines") local S = technic.getter local tube_entry = "^pipeworks_tube_connection_metallic.png" +local cable_entry = "^technic_cable_connection_overlay.png" local fs_helpers = pipeworks.fs_helpers @@ -132,7 +133,14 @@ function technic.register_battery_box(data) end local run = function(pos, node) + local below = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) local meta = minetest.get_meta(pos) + + if below.name ~= "technic:"..ltier.."_cable" then + meta:set_string("infotext", S("%s Battery Box Has No Network"):format(tier)) + return + end + local eu_input = meta:get_int(tier.."_EU_input") local current_charge = meta:get_int("internal_EU_charge") @@ -208,20 +216,27 @@ function technic.register_battery_box(data) groups.tubedevice_receiver = 1 end - local tentry = tube_entry + local top_tex = "technic_"..ltier.."_battery_box_top.png"..tube_entry + local front_tex = "technic_"..ltier.."_battery_box_front.png^technic_power_meter"..i..".png" + local side_tex = "technic_"..ltier.."_battery_box_side.png"..tube_entry + local bottom_tex = "technic_"..ltier.."_battery_box_bottom.png"..tube_entry + if ltier == "lv" then - tentry = "" + top_tex = "technic_"..ltier.."_battery_box_top.png" + front_tex = "technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png" + side_tex = "technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png" + bottom_tex = "technic_"..ltier.."_battery_box_bottom.png"..cable_entry end minetest.register_node("technic:"..ltier.."_battery_box"..i, { description = S("%s Battery Box"):format(tier), tiles = { - "technic_"..ltier.."_battery_box_top.png"..tentry, - "technic_"..ltier.."_battery_box_bottom.png"..tentry, - "technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png", - "technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png", - "technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png", - "technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png"}, + top_tex, + bottom_tex, + side_tex, + side_tex, + side_tex, + front_tex}, groups = groups, connect_sides = {"bottom"}, tube = data.tube and tube or nil, |