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.tank.drain(currentWithdraw, true);
|
||||
this.pendingWithdraw -= currentWithdraw;
|
||||
|
||||
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,7 +10,7 @@ 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
|
||||
|
|
|
@ -10,7 +10,7 @@ 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
|
||||
|
|
Loading…
Reference in a new issue