diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-04-27 04:50:37 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-04-27 10:42:25 -0500 |
commit | 3bbfb41798e926e9a186f5c408320e3671ad13b4 (patch) | |
tree | 7613402c2710f045d35b752731a1e04662b0c218 /src/main/java/net/minecraft/server/TileEntityFurnace.java | |
parent | 799779e4b19605dc7d7befd0b530caf640214d14 (diff) | |
download | craftbukkit-3bbfb41798e926e9a186f5c408320e3671ad13b4.tar craftbukkit-3bbfb41798e926e9a186f5c408320e3671ad13b4.tar.gz craftbukkit-3bbfb41798e926e9a186f5c408320e3671ad13b4.tar.lz craftbukkit-3bbfb41798e926e9a186f5c408320e3671ad13b4.tar.xz craftbukkit-3bbfb41798e926e9a186f5c408320e3671ad13b4.zip |
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.
Diffstat (limited to 'src/main/java/net/minecraft/server/TileEntityFurnace.java')
-rw-r--r-- | src/main/java/net/minecraft/server/TileEntityFurnace.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java index 05a07b93..e0f6cda3 100644 --- a/src/main/java/net/minecraft/server/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java @@ -166,7 +166,7 @@ public class TileEntityFurnace extends TileEntity implements IWorldInventory { boolean flag1 = false; // CraftBukkit start - Use wall time instead of ticks for cooking - int elapsedTicks = Math.max(1, MinecraftServer.currentTick - this.lastTick); + int elapsedTicks = MinecraftServer.currentTick - this.lastTick; this.lastTick = MinecraftServer.currentTick; // CraftBukkit - moved from below |