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();
|
this.syncWithAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.tank.getFluidAmount() > 0 && tryAddingEnergy(euTick)) {
|
if (this.tank.getFluidAmount() > 0) {
|
||||||
this.getRecipes().getRecipeForFluid(tank.getFluidType()).ifPresent(recipe -> {
|
this.getRecipes().getRecipeForFluid(tank.getFluidType()).ifPresent(recipe -> {
|
||||||
|
|
||||||
final Integer euPerBucket = recipe.getEnergyPerMb() * 1000;
|
if(tryAddingEnergy(euTick))
|
||||||
final float millibucketsPerTick = 16000f / (float) euPerBucket;
|
{
|
||||||
this.pendingWithdraw += millibucketsPerTick;
|
final Integer euPerBucket = recipe.getEnergyPerMb() * 1000;
|
||||||
|
final float millibucketsPerTick = 16000f / (float) euPerBucket;
|
||||||
|
this.pendingWithdraw += millibucketsPerTick;
|
||||||
|
|
||||||
final int currentWithdraw = (int) this.pendingWithdraw; // float
|
final int currentWithdraw = (int) this.pendingWithdraw;
|
||||||
// -->
|
|
||||||
// int
|
|
||||||
// conversion floors
|
|
||||||
// the float
|
|
||||||
this.pendingWithdraw -= currentWithdraw;
|
|
||||||
|
|
||||||
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 class TileDieselGenerator extends TileBaseFluidGenerator {
|
||||||
|
|
||||||
public TileDieselGenerator() {
|
public TileDieselGenerator() {
|
||||||
super(EFluidGenerator.DIESEL, ConfigTechReborn.ThermalGeneratorTier, "TileDieselGenerator", 1000*10, ConfigTechReborn.ThermalGeneratorOutput);
|
super(EFluidGenerator.DIESEL, ConfigTechReborn.ThermalGeneratorTier, "TileDieselGenerator", 1000 * 10,
|
||||||
|
ConfigTechReborn.ThermalGeneratorOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -10,7 +10,7 @@ import techreborn.init.ModBlocks;
|
||||||
public class TileGasTurbine extends TileBaseFluidGenerator {
|
public class TileGasTurbine extends TileBaseFluidGenerator {
|
||||||
|
|
||||||
public TileGasTurbine() {
|
public TileGasTurbine() {
|
||||||
super(EFluidGenerator.GAS, ConfigTechReborn.ThermalGeneratorTier, "TileGasTurbine", 1000*10, 16);
|
super(EFluidGenerator.GAS, ConfigTechReborn.ThermalGeneratorTier, "TileGasTurbine", 1000 * 10, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -10,7 +10,7 @@ import techreborn.init.ModBlocks;
|
||||||
public class TileSemifluidGenerator extends TileBaseFluidGenerator {
|
public class TileSemifluidGenerator extends TileBaseFluidGenerator {
|
||||||
|
|
||||||
public TileSemifluidGenerator() {
|
public TileSemifluidGenerator() {
|
||||||
super(EFluidGenerator.SEMIFLUID, ConfigTechReborn.ThermalGeneratorTier, "TileSemifluidGenerator", 1000*10, 8);
|
super(EFluidGenerator.SEMIFLUID, ConfigTechReborn.ThermalGeneratorTier, "TileSemifluidGenerator", 1000 * 10, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue