Fixed Coal Generator using infinite resources even though full

Fixed Oil Generator not visually turning off.
This commit is contained in:
Ellpeck 2015-12-20 16:10:48 +01:00
parent cf5a52db2d
commit 3857ed0e8b
2 changed files with 3 additions and 3 deletions

View file

@ -56,7 +56,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
this.storage.receiveEnergy(PRODUCE, false);
}
if(this.currentBurnTime <= 0 && this.slots[0] != null && TileEntityFurnace.getItemBurnTime(this.slots[0]) > 0){
if(this.currentBurnTime <= 0 && this.slots[0] != null && TileEntityFurnace.getItemBurnTime(this.slots[0]) > 0 && this.storage.getEnergyStored() < this.storage.getMaxEnergyStored()){
int burnTime = TileEntityFurnace.getItemBurnTime(this.slots[0]);
this.maxBurnTime = burnTime;
this.currentBurnTime = burnTime;
@ -80,7 +80,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
this.markDirty();
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
if(meta == 1){
if(!(this.currentBurnTime <= 0 && this.slots[0] != null && TileEntityFurnace.getItemBurnTime(this.slots[0]) > 0)){
if(!(this.currentBurnTime <= 0 && this.slots[0] != null && TileEntityFurnace.getItemBurnTime(this.slots[0]) > 0 && this.storage.getEnergyStored() < this.storage.getMaxEnergyStored())){
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2);
}
}

View file

@ -86,7 +86,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I
this.markDirty();
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
if(meta == 1){
if(!(ENERGY_PRODUCED*BURN_TIME <= this.getMaxEnergyStored(ForgeDirection.UNKNOWN)-this.getEnergyStored(ForgeDirection.UNKNOWN) && FluidContainerRegistry.BUCKET_VOLUME <= this.tank.getCapacity()-this.tank.getFluidAmount())){
if(!(ENERGY_PRODUCED*BURN_TIME <= this.getMaxEnergyStored(ForgeDirection.UNKNOWN)-this.getEnergyStored(ForgeDirection.UNKNOWN) && this.currentBurnTime <= 0 && this.tank.getFluidAmount() >= fuelUsed)){
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2);
}
}