mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +01:00
Fixed Coal Generator using infinite resources even though full
Fixed Oil Generator not visually turning off.
This commit is contained in:
parent
cf5a52db2d
commit
3857ed0e8b
2 changed files with 3 additions and 3 deletions
|
@ -56,7 +56,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
|
||||||
this.storage.receiveEnergy(PRODUCE, false);
|
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]);
|
int burnTime = TileEntityFurnace.getItemBurnTime(this.slots[0]);
|
||||||
this.maxBurnTime = burnTime;
|
this.maxBurnTime = burnTime;
|
||||||
this.currentBurnTime = burnTime;
|
this.currentBurnTime = burnTime;
|
||||||
|
@ -80,7 +80,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
|
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
|
||||||
if(meta == 1){
|
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);
|
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
|
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
|
||||||
if(meta == 1){
|
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);
|
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue