Fix FluidGenerators activation and energy production
This commit is contained in:
parent
003d124667
commit
1d27182cc2
4 changed files with 20 additions and 17 deletions
|
@ -64,21 +64,23 @@ public abstract class TileBaseFluidGenerator extends TilePowerAcceptor implement
|
|||
this.syncWithAll();
|
||||
}
|
||||
|
||||
if (this.tank.getFluidAmount() > 0 && tryAddingEnergy(euTick)) {
|
||||
if (this.tank.getFluidAmount() > 0) {
|
||||
this.getRecipes().getRecipeForFluid(tank.getFluidType()).ifPresent(recipe -> {
|
||||
|
||||
final Integer euPerBucket = recipe.getEnergyPerMb() * 1000;
|
||||
final float millibucketsPerTick = 16000f / (float) euPerBucket;
|
||||
this.pendingWithdraw += millibucketsPerTick;
|
||||
if(tryAddingEnergy(euTick))
|
||||
{
|
||||
final Integer euPerBucket = recipe.getEnergyPerMb() * 1000;
|
||||
final float millibucketsPerTick = 16000f / (float) euPerBucket;
|
||||
this.pendingWithdraw += millibucketsPerTick;
|
||||
|
||||
final int currentWithdraw = (int) this.pendingWithdraw; // float
|
||||
// -->
|
||||
// int
|
||||
// conversion floors
|
||||
// the float
|
||||
this.pendingWithdraw -= currentWithdraw;
|
||||
final int currentWithdraw = (int) this.pendingWithdraw;
|
||||
|
||||
this.pendingWithdraw -= currentWithdraw;
|
||||
|
||||
this.tank.drain(currentWithdraw, true);
|
||||
this.tank.drain(currentWithdraw, true);
|
||||
|
||||
this.lastOutput = this.world.getTotalWorldTime();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,8 @@ import techreborn.init.ModBlocks;
|
|||
public class TileDieselGenerator extends TileBaseFluidGenerator {
|
||||
|
||||
public TileDieselGenerator() {
|
||||
super(EFluidGenerator.DIESEL, ConfigTechReborn.ThermalGeneratorTier, "TileDieselGenerator", 1000*10, ConfigTechReborn.ThermalGeneratorOutput);
|
||||
super(EFluidGenerator.DIESEL, ConfigTechReborn.ThermalGeneratorTier, "TileDieselGenerator", 1000 * 10,
|
||||
ConfigTechReborn.ThermalGeneratorOutput);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,14 +10,14 @@ import techreborn.init.ModBlocks;
|
|||
public class TileGasTurbine extends TileBaseFluidGenerator {
|
||||
|
||||
public TileGasTurbine() {
|
||||
super(EFluidGenerator.GAS, ConfigTechReborn.ThermalGeneratorTier, "TileGasTurbine", 1000*10, 16);
|
||||
super(EFluidGenerator.GAS, ConfigTechReborn.ThermalGeneratorTier, "TileGasTurbine", 1000 * 10, 16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(ModBlocks.gasTurbine, 1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public EnumPowerTier getTier() {
|
||||
return EnumPowerTier.MEDIUM;
|
||||
|
|
|
@ -10,9 +10,9 @@ import techreborn.init.ModBlocks;
|
|||
public class TileSemifluidGenerator extends TileBaseFluidGenerator {
|
||||
|
||||
public TileSemifluidGenerator() {
|
||||
super(EFluidGenerator.SEMIFLUID, ConfigTechReborn.ThermalGeneratorTier, "TileSemifluidGenerator", 1000*10, 8);
|
||||
super(EFluidGenerator.SEMIFLUID, ConfigTechReborn.ThermalGeneratorTier, "TileSemifluidGenerator", 1000 * 10, 8);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer arg0) {
|
||||
return new ItemStack(ModBlocks.semiFluidGenerator, 1);
|
||||
|
@ -22,7 +22,7 @@ public class TileSemifluidGenerator extends TileBaseFluidGenerator {
|
|||
public EnumPowerTier getTier() {
|
||||
return EnumPowerTier.LOW;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getMaxPower() {
|
||||
return ConfigTechReborn.ThermalGeneratorCharge;
|
||||
|
|
Loading…
Reference in a new issue