From 1bc51d43ba3822ff31529a4a50d35e6e539660f7 Mon Sep 17 00:00:00 2001 From: DarkGuardsman Date: Mon, 13 Jan 2014 07:55:46 -0500 Subject: [PATCH] Fixed a crash and re-add pipe gauge --- .../fluid/network/FluidNetwork.java | 6 +- .../mechanical/item/ItemReadoutTools.java | 122 ++++++++++++++++++ 2 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 src/main/java/resonantinduction/mechanical/item/ItemReadoutTools.java diff --git a/src/main/java/resonantinduction/mechanical/fluid/network/FluidNetwork.java b/src/main/java/resonantinduction/mechanical/fluid/network/FluidNetwork.java index f5f4bd194..169fd5014 100644 --- a/src/main/java/resonantinduction/mechanical/fluid/network/FluidNetwork.java +++ b/src/main/java/resonantinduction/mechanical/fluid/network/FluidNetwork.java @@ -15,7 +15,7 @@ import calclavia.lib.utility.FluidHelper; public class FluidNetwork extends Network implements IFluidNetwork { - protected FluidTank tank; + protected FluidTank tank = new FluidTank(0); protected final FluidTankInfo[] tankInfo = new FluidTankInfo[1]; protected boolean loadPart = false; protected long ticks = 0; @@ -281,6 +281,10 @@ public class FluidNetwork extends Network 100) + { + output = output.substring(0, 100); + } + output.trim(); + player.sendChatToPlayer(ChatMessageComponent.createFromText("ReadOut> " + output)); + return true; + } + } + if (tool == EnumTools.PIPE_GUAGE) + { + if (tileEntity instanceof IFluidHandler) + { + FluidTankInfo[] tanks = ((IFluidHandler) tileEntity).getTankInfo(ForgeDirection.getOrientation(side)); + if (tanks != null) + { + player.sendChatToPlayer(ChatMessageComponent.createFromText("FluidHandler> Side:" + hitSide.toString() + " Tanks:" + tanks.length)); + for (FluidStack stack : FluidHelper.getFluidList(tanks)) + { + player.sendChatToPlayer(ChatMessageComponent.createFromText("Fluid>" + stack.amount + "mb of " + stack.getFluid().getName())); + } + return true; + } + } + } + } + + } + + return false; + } +}