Fixed crash on sink loading

This commit is contained in:
DarkGuardsman 2013-07-25 10:47:10 -04:00
parent d0951bfe7e
commit ff46fb58f5
2 changed files with 6 additions and 9 deletions

View file

@ -44,17 +44,13 @@ public class TileEntitySink extends TileEntityFluidStorage implements IPacketRec
@Override
public Packet getDescriptionPacket()
{
FluidStack stack = this.getTank().getFluid();
if (stack != null && stack.getFluid() != null)
FluidStack stack = new FluidStack(FluidRegistry.WATER, 0);
if (this.getTank().getFluid() != null)
{
return PacketManager.getPacket(FluidMech.CHANNEL, this, stack.writeToNBT(new NBTTagCompound()));
stack = this.getTank().getFluid();
}
else
{
stack = new FluidStack(FluidRegistry.WATER, 0);
return PacketManager.getPacket(FluidMech.CHANNEL, this, stack.writeToNBT(new NBTTagCompound()));
}
}
@Override
public void handlePacketData(INetworkManager network, int packetType, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput data)
@ -66,7 +62,7 @@ public class TileEntitySink extends TileEntityFluidStorage implements IPacketRec
catch (Exception e)
{
e.printStackTrace();
System.out.print("Fail reading data for Storage tank \n");
System.out.println("Fail reading data for fluid sink");
}
}

View file

@ -489,6 +489,7 @@ public class TileEntityPipe extends TileEntityAdvanced implements IFluidHandler,
FluidStack stack = tankContainer.drain(dir, FluidContainerRegistry.BUCKET_VOLUME, false);
if (stack != null && stack.amount > 0)
{
//TODO change this to be turned off or leave it as is for not using valves
int fill = ((NetworkPipes) this.getTileNetwork()).addFluidToNetwork((TileEntity) tankContainer, stack, true);
tankContainer.drain(dir, fill, true);
}