Tech Reborn

Tech Reborn

30M Downloads

What's the intended overclocker limit? (Speed increase limit is defined twice with different values)

KonSola5 opened this issue ยท 2 comments

commented

Describe the bug
On default configs:
Each Overclocker reduces the ticks needed (a.k.a. the "speed multiplier") by 0.25.
So according to this code in MachineBaseBlockEntity:

@Override
public void addSpeedMultiplier(double amount) {
if (speedMultiplier + amount <= SPEED_CAP) {
speedMultiplier += amount;
} else {
speedMultiplier = SPEED_CAP;
}
}

the speed cap gets clamped to 0.99 with 4 overclockers.

However, when it comes to calculating the final amount of ticks needed for recipe, the value gets clamped AGAIN by the getSpeedMultiplier in RecipeCrafter:

@Override
public double getSpeedMultiplier() {
return Math.min(parentUpgradeHandler.map(IUpgradeHandler::getSpeedMultiplier).orElse(0D), 0.975);
}

to 0.975.

What's the intended speed cap then? 99% or 97.5%?

Steps to Reproduce
Steps to reproduce the behavior:

  1. Open Minecraft in debug mode
  2. Place a machine and insert 4 Overclocker Upgrades into it
  3. Observe that the needed ticks for a recipe that takes 5000 ticks is 125 ticks.
  4. Use a breakpoint on the getSpeedMultiplier in RecipeCrafter - that's a point between two clamps.

Environment (please complete the following information with the version):

  • Minecraft: Any (present on 1.20.4)
  • Mod Loader: Fabric

Logs
No logs, since it's an issue with the coding.

Additional context
I was trying to find out, why the top machine speed is 97.5% instead of 99%.
After some debugging, finally found out that the value is clamped twice.

commented

Guess it's 99% then.

Please also reflect this in the overclocker tooltip helper.

commented

Yepp, 99%