Fixed some tank null point exceptions
This commit is contained in:
parent
7bea838a12
commit
3069774a44
4 changed files with 5 additions and 4 deletions
|
@ -3,6 +3,7 @@ package resonantinduction.archaic.fluid.tank;
|
|||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.PriorityQueue;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
|
|
@ -31,7 +31,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
|
||||
public class PartPipe extends PartFramedNode<EnumPipeMaterial, FluidPressureNode, IPressureNodeProvider> implements IPressureNodeProvider, TSlottedPart, JNormalOcclusion, IHollowConnect
|
||||
{
|
||||
protected FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME);
|
||||
protected final FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME);
|
||||
/**
|
||||
* Computes the average fluid for client to render.
|
||||
*/
|
||||
|
@ -183,7 +183,7 @@ public class PartPipe extends PartFramedNode<EnumPipeMaterial, FluidPressureNode
|
|||
{
|
||||
if (packetID == 3)
|
||||
{
|
||||
tank = new FluidTank(packet.readInt());
|
||||
tank.setCapacity(packet.readInt());
|
||||
tank.readFromNBT(packet.readNBTTagCompound());
|
||||
}
|
||||
else
|
||||
|
|
|
@ -149,7 +149,7 @@ public class TilePump extends TileMechanical implements IPressureNodeProvider, I
|
|||
@Override
|
||||
public FluidTank getPressureTank()
|
||||
{
|
||||
return null;
|
||||
return new FluidTank(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -115,7 +115,7 @@ public abstract class TileFluidNode extends TileBase implements IPacketReceiverW
|
|||
@Override
|
||||
public Packet getDescriptionPacket()
|
||||
{
|
||||
if (getInternalTank().getFluid() == null || getInternalTank().getFluid().getFluid().getName() != null)
|
||||
if (getInternalTank().getFluid() == null || (getInternalTank().getFluid() != null && getInternalTank().getFluid().getFluid().getName() != null))
|
||||
return ResonantInduction.PACKET_TILE.getPacketWithID(PACKET_DESCRIPTION, this, this.colorID, this.renderSides, getInternalTank().getCapacity(), getInternalTank().writeToNBT(new NBTTagCompound()));
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue