diff --git a/src/main/java/resonantinduction/mechanical/fluid/prefab/TileFluidNetwork.java b/src/main/java/resonantinduction/mechanical/fluid/prefab/TileFluidNetwork.java index 02fb48fec..a169380d8 100644 --- a/src/main/java/resonantinduction/mechanical/fluid/prefab/TileFluidNetwork.java +++ b/src/main/java/resonantinduction/mechanical/fluid/prefab/TileFluidNetwork.java @@ -61,20 +61,6 @@ public abstract class TileFluidNetwork extends TileAdvanced implements IFluidCon getNetwork().reconstruct(); } - @Override - public void onFluidChanged() - { - if (!worldObj.isRemote) - { - if (!FluidUtility.matchExact(prevStack, this.getInternalTank().getFluid())) - { - this.sendTankUpdate(); - } - - this.prevStack = this.tank.getFluid(); - } - } - @Override public void invalidate() { @@ -264,10 +250,23 @@ public abstract class TileFluidNetwork extends TileAdvanced implements IFluidCon public void sendTankUpdate() { - System.out.println("Send Amount: " + this.getInternalTank().getFluidAmount()); PacketHandler.sendPacketToClients(ResonantInduction.PACKET_TILE.getPacketWithID(PACKET_TANK, this, getInternalTank().getCapacity(), getInternalTank().writeToNBT(new NBTTagCompound())), this.worldObj, new Vector3(this), 60); } + @Override + public void onFluidChanged() + { + if (!worldObj.isRemote) + { + if (!FluidUtility.matchExact(prevStack, this.getInternalTank().getFluid())) + { + sendTankUpdate(); + } + + prevStack = tank.getFluid(); + } + } + @Override @SideOnly(Side.CLIENT) public AxisAlignedBB getRenderBoundingBox() diff --git a/src/main/java/resonantinduction/mechanical/fluid/tank/BlockTank.java b/src/main/java/resonantinduction/mechanical/fluid/tank/BlockTank.java index 95be48438..c5c6c8492 100644 --- a/src/main/java/resonantinduction/mechanical/fluid/tank/BlockTank.java +++ b/src/main/java/resonantinduction/mechanical/fluid/tank/BlockTank.java @@ -67,7 +67,6 @@ public class BlockTank extends BlockFluidNetwork if (!world.isRemote) { - return FluidUtility.playerActivatedFluidItem(world, x, y, z, entityplayer, side); } return true; diff --git a/src/main/java/resonantinduction/mechanical/fluid/tank/TankNetwork.java b/src/main/java/resonantinduction/mechanical/fluid/tank/TankNetwork.java index bc1a3bf19..80e0c8a82 100644 --- a/src/main/java/resonantinduction/mechanical/fluid/tank/TankNetwork.java +++ b/src/main/java/resonantinduction/mechanical/fluid/tank/TankNetwork.java @@ -17,7 +17,7 @@ public class TankNetwork extends FluidNetwork { @Override public void distributeConnectors() - { + { FluidStack fillStack = this.getTank().getFluid(); int lowestY = 255, highestY = 0; @@ -28,16 +28,19 @@ public class TankNetwork extends FluidNetwork else if (this.getConnectors().size() > 0) { fillStack = fillStack.copy(); - for (IFluidConnector part : this.getConnectors()) + + for (IFluidConnector connector : this.getConnectors()) { - part.getInternalTank().setFluid(null); - if (part instanceof TileEntity && ((TileEntity) part).yCoord < lowestY) + connector.getInternalTank().setFluid(null); + connector.onFluidChanged(); + + if (connector instanceof TileEntity && ((TileEntity) connector).yCoord < lowestY) { - lowestY = ((TileEntity) part).yCoord; + lowestY = ((TileEntity) connector).yCoord; } - if (part instanceof TileEntity && ((TileEntity) part).yCoord > highestY) + if (connector instanceof TileEntity && ((TileEntity) connector).yCoord > highestY) { - highestY = ((TileEntity) part).yCoord; + highestY = ((TileEntity) connector).yCoord; } }