mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 19:55:52 -07:00
Fix things using wall time running too fast. Fixes BUKKIT-4155
When converting things in Minecraft to use wall time instead of ticks I realized we'd run into integer division rounding issues and could have updates that end up counting as zero ticks. To compensate for this the code ensures we always process at least one tick. However, every time we end up with zero ticks the next time we have an extra tick due to rounding the other way with the leftovers. This means we are going far too fast and should not have this at least one tick logic at all. On top of this some potions rely on the number of ticks they run and not just the amount of time they last and so potions were put back to running with ticks entirely.
This commit is contained in:
@@ -121,7 +121,7 @@ public class EntityZombie extends EntityMonster {
|
||||
int i = this.q();
|
||||
|
||||
// CraftBukkit start - Use wall time instead of ticks for villager conversion
|
||||
int elapsedTicks = Math.max(1, MinecraftServer.currentTick - this.lastTick);
|
||||
int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
|
||||
this.lastTick = MinecraftServer.currentTick;
|
||||
i *= elapsedTicks;
|
||||
// CraftBukkit end
|
||||
|
Reference in New Issue
Block a user