Fixed fluid syncing issues, fixed liquid item dropping when block broken

This commit is contained in:
modmuss50 2015-06-14 11:58:56 +01:00
parent f5bd04db3c
commit 755c64369a
7 changed files with 30 additions and 8 deletions

View file

@ -16,6 +16,7 @@ public class TileAesu extends TileEntityElectricBlock implements IWrenchable {
public static final int MAX_STORAGE = 1000000000; //One billion!
public Inventory inventory = new Inventory(2, "TileAesu", 64);
private int OUTPUT = 64; //The current output
private double euLastTick = 0;
public TileAesu()
{
@ -26,7 +27,7 @@ public class TileAesu extends TileEntityElectricBlock implements IWrenchable {
public void updateEntity()
{
super.updateEntity();
euLastTick = energy;
}
@Override
@ -115,4 +116,9 @@ public class TileAesu extends TileEntityElectricBlock implements IWrenchable {
LogHelper.debug("Set output to " + getOutput());
}
public double getEuChange(){
return energy - euLastTick;
}
}

View file

@ -157,7 +157,8 @@ public class TileDieselGenerator extends TileEntity implements IWrenchable,
public void updateEntity()
{
super.updateEntity();
FluidUtils.drainContainers(this, inventory, 0, 1);
if(!worldObj.isRemote)
FluidUtils.drainContainers(this, inventory, 0, 1);
energySource.updateEntity();
if (tank.getFluidAmount() > 0
&& energySource.getCapacity() - energySource.getEnergyStored() >= euTick)

View file

@ -180,7 +180,8 @@ public class TileSemifluidGenerator extends TileEntity implements IWrenchable,
public void updateEntity()
{
super.updateEntity();
FluidUtils.drainContainers(this, inventory, 0, 1);
if(!worldObj.isRemote)
FluidUtils.drainContainers(this, inventory, 0, 1);
energySource.updateEntity();
if (tank.getFluidAmount() > 0
&& energySource.getCapacity() - energySource.getEnergyStored() >= euTick)

View file

@ -163,7 +163,8 @@ public class TileThermalGenerator extends TileEntity implements IWrenchable,
public void updateEntity()
{
super.updateEntity();
FluidUtils.drainContainers(this, inventory, 0, 1);
if(!worldObj.isRemote)
FluidUtils.drainContainers(this, inventory, 0, 1);
energySource.updateEntity();
if (tank.getFluidAmount() > 0
&& energySource.getCapacity() - energySource.getEnergyStored() >= euTick)