Skip to content

Commit

Permalink
Merge pull request #85 from iouter/1tick
Browse files Browse the repository at this point in the history
fix factories consuming an extra 1 tick of gas when the recipe is completed
  • Loading branch information
sddsd2332 authored Nov 17, 2024
2 parents bd8d4bf + 43635cc commit fa905d6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ public void onUpdate() {
}
if ((progress[process] + 1) < ticksRequired) {
progress[process]++;
gasTank.draw(secondaryEnergyThisTick, tier != FactoryTier.CREATIVE);
TypeUpdate(process, Exenery);

} else if ((progress[process] + 1) >= ticksRequired && ((recipeType == RecipeType.PRC || recipeType == RecipeType.NUCLEOSYNTHESIZER) ? getEnergy() >= MekanismUtils.getEnergyPerTick(this, BASE_ENERGY_PER_TICK + Exenery) : getEnergy() >= energyPerTick)) {
Expand Down Expand Up @@ -449,7 +450,6 @@ private void MachineTypeSwitching() {
}

private void TypeUpdate(int process, double Exenery) {
gasTank.draw(secondaryEnergyThisTick, tier != FactoryTier.CREATIVE);
if (tier != FactoryTier.CREATIVE) {
if (recipeType == RecipeType.PRC || recipeType == RecipeType.NUCLEOSYNTHESIZER) {
electricityStored.addAndGet(-MekanismUtils.getEnergyPerTick(this, BASE_ENERGY_PER_TICK + Exenery));
Expand Down

0 comments on commit fa905d6

Please sign in to comment.