A few tiny fixes

This commit is contained in:
Aidan C. Brady 2014-03-22 12:24:09 -04:00
parent 00a54498dc
commit ef558016a4
5 changed files with 13 additions and 16 deletions

View file

@ -49,7 +49,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer
bindTexture(MekanismRenderer.getBlocksTexture());
if(data.location != null && data.height > 0 && tileEntity.structure.fluidStored.getFluid() != null)
if(data.location != null && data.height >= 3 && tileEntity.structure.fluidStored.getFluid() != null)
{
push();

View file

@ -160,7 +160,7 @@ public class PartMechanicalPipe extends PartTransmitter<FluidNetwork> implements
{
super.save(nbtTags);
if(getTransmitterNetwork().fluidStored != null)
if(getTransmitterNetwork(false) != null && getTransmitterNetwork(false).getSize() > 0 && getTransmitterNetwork(false).fluidStored != null)
{
int remain = getTransmitterNetwork().fluidStored.amount%getTransmitterNetwork().transmitters.size();
int toSave = getTransmitterNetwork().fluidStored.amount/getTransmitterNetwork().transmitters.size();

View file

@ -149,7 +149,7 @@ public class PartPressurizedTube extends PartTransmitter<GasNetwork>
{
super.save(nbtTags);
if(getTransmitterNetwork().gasStored != null)
if(getTransmitterNetwork(false) != null && getTransmitterNetwork(false).getSize() > 0 && getTransmitterNetwork(false).gasStored != null)
{
int remain = getTransmitterNetwork().gasStored.amount%getTransmitterNetwork().transmitters.size();
int toSave = getTransmitterNetwork().gasStored.amount/getTransmitterNetwork().transmitters.size();

View file

@ -85,7 +85,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
{
FluidStack fluid = FluidContainerRegistry.getFluidForFilledItem(inventory[0]);
if(fluidTank.getFluid() == null || fluid.isFluidEqual(fluidTank.getFluid()) && fluidTank.getFluid().amount+fluid.amount <= fluidTank.getCapacity())
if(fluid != null && fluidTank.getFluid() == null || fluid.isFluidEqual(fluidTank.getFluid()) && fluidTank.getFluid().amount+fluid.amount <= fluidTank.getCapacity())
{
fluidTank.fill(fluid, true);

View file

@ -61,6 +61,15 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements IPe
{
CableUtils.emit(this);
}
int newScale = getScaledEnergyLevel(100);
if(newScale != prevScale)
{
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(this), getNetworkedData(new ArrayList())), Coord4D.get(this), 50D);
}
prevScale = newScale;
}
@Override
@ -236,18 +245,6 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements IPe
onInventoryChanged();
currentRedstoneLevel = newRedstoneLevel;
}
if(!worldObj.isRemote)
{
int newScale = getScaledEnergyLevel(100);
if(newScale != prevScale)
{
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(this), getNetworkedData(new ArrayList())), Coord4D.get(this), 50D);
}
prevScale = newScale;
}
}
public int getRedstoneLevel()