From ef558016a45b2c299ffa5ec78017699f0421bb2b Mon Sep 17 00:00:00 2001 From: "Aidan C. Brady" Date: Sat, 22 Mar 2014 12:24:09 -0400 Subject: [PATCH] A few tiny fixes --- .../render/tileentity/RenderDynamicTank.java | 2 +- .../common/multipart/PartMechanicalPipe.java | 2 +- .../common/multipart/PartPressurizedTube.java | 2 +- .../tile/TileEntityElectrolyticSeparator.java | 2 +- .../common/tile/TileEntityEnergyCube.java | 21 ++++++++----------- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/common/mekanism/client/render/tileentity/RenderDynamicTank.java b/common/mekanism/client/render/tileentity/RenderDynamicTank.java index 9808237fd..5325130b1 100644 --- a/common/mekanism/client/render/tileentity/RenderDynamicTank.java +++ b/common/mekanism/client/render/tileentity/RenderDynamicTank.java @@ -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(); diff --git a/common/mekanism/common/multipart/PartMechanicalPipe.java b/common/mekanism/common/multipart/PartMechanicalPipe.java index cd066e75a..2ba931b02 100644 --- a/common/mekanism/common/multipart/PartMechanicalPipe.java +++ b/common/mekanism/common/multipart/PartMechanicalPipe.java @@ -160,7 +160,7 @@ public class PartMechanicalPipe extends PartTransmitter 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(); diff --git a/common/mekanism/common/multipart/PartPressurizedTube.java b/common/mekanism/common/multipart/PartPressurizedTube.java index 4655c6481..f2d9c83cb 100644 --- a/common/mekanism/common/multipart/PartPressurizedTube.java +++ b/common/mekanism/common/multipart/PartPressurizedTube.java @@ -149,7 +149,7 @@ public class PartPressurizedTube extends PartTransmitter { 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(); diff --git a/common/mekanism/common/tile/TileEntityElectrolyticSeparator.java b/common/mekanism/common/tile/TileEntityElectrolyticSeparator.java index 88260e7fb..f941c2284 100644 --- a/common/mekanism/common/tile/TileEntityElectrolyticSeparator.java +++ b/common/mekanism/common/tile/TileEntityElectrolyticSeparator.java @@ -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); diff --git a/common/mekanism/common/tile/TileEntityEnergyCube.java b/common/mekanism/common/tile/TileEntityEnergyCube.java index 48eade9d0..2b2f1a145 100644 --- a/common/mekanism/common/tile/TileEntityEnergyCube.java +++ b/common/mekanism/common/tile/TileEntityEnergyCube.java @@ -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()