From 10307f23a78b33af50dc4a5f3d1baafb4ee4b0d9 Mon Sep 17 00:00:00 2001
From: Maciej 'agaran' Pijanka <agaran@pld-linux.org>
Date: Thu, 16 Mar 2017 00:00:22 +0100
Subject: [PATCH] Do not run converters twice.

---
 technic/machines/register/battery_box.lua |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/technic/machines/register/battery_box.lua b/technic/machines/register/battery_box.lua
index 244a0bc..953f7af 100644
--- a/technic/machines/register/battery_box.lua
+++ b/technic/machines/register/battery_box.lua
@@ -71,13 +71,21 @@
 		"label[3,0;"..S("Charge").."]"..
 		"label[5,0;"..S("Discharge").."]"..
 		"label[1,3;"..S("Power level").."]"..
-		"list[current_player;main;0,5;8,4;]"
-	
+		"list[current_player;main;0,5;8,4;]"..
+		"listring[current_name;dst]"..
+		"listring[current_player;main]"..
+		"listring[current_name;src]"..
+		"listring[current_player;main]"
+
 	if data.upgrade then
 		formspec = formspec..
 			"list[current_name;upgrade1;3.5,3;1,1;]"..
 			"list[current_name;upgrade2;4.5,3;1,1;]"..
-			"label[3.5,4;"..S("Upgrade Slots").."]"
+			"label[3.5,4;"..S("Upgrade Slots").."]"..
+			"listring[current_name;upgrade1]"..
+			"listring[current_player;main]"..
+			"listring[current_name;upgrade2]"..
+			"listring[current_player;main]"
 	end
 
 	local run = function(pos, node)
@@ -142,8 +150,8 @@
 			.."^[lowpart:"..charge_percent
 			..":technic_power_meter_fg.png]")
 
-		local infotext = technic.format(S("%s Battery Box: %e/%e"), tier,
-				current_charge, max_charge)
+		local infotext = S("@1 Battery Box: @2/@3", tier,
+				technic.pretty_num(current_charge), technic.pretty_num(max_charge))
 		if eu_input == 0 then
 			infotext = S("%s Idle"):format(infotext)
 		end
@@ -151,7 +159,8 @@
 	end
 	
 	for i = 0, 8 do
-		local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1}
+		local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
+				technic_machine=1, ["technic_"..ltier]=1}
 		if i ~= 0 then
 			groups.not_in_creative_inventory = 1
 		end
@@ -170,6 +179,7 @@
 				 "technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png",
 				 "technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png"},
 			groups = groups,
+			connect_sides = {"bottom"},
 			tube = data.tube and tube or nil,
 			paramtype2 = "facedir",
 			sounds = default.node_sound_wood_defaults(),
@@ -195,8 +205,8 @@
 			allow_metadata_inventory_take = technic.machine_inventory_take,
 			allow_metadata_inventory_move = technic.machine_inventory_move,
 			technic_run = run,
-			after_place_node = (not tube) or pipeworks.after_place,
-			after_dig_node = (not tube) or pipeworks.after_dig
+			after_place_node = data.tube and pipeworks.after_place,
+			after_dig_node = technic.machine_after_dig_node
 		})
 	end
 

--
Gitblit v1.8.0