summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorEvilSeph <evilseph@unaligned.org>2011-05-19 00:45:42 -0400
committerEvilSeph <evilseph@unaligned.org>2011-05-19 00:45:42 -0400
commitafb08bb0c5922f77883e297b3d2478827a7a21e9 (patch)
tree81446770b6088e0f9e20d39d425cba1dfb114051 /src/main
parenteac5b9623d771abd3ea480eaeb33404b4410d3b6 (diff)
downloadcraftbukkit-afb08bb0c5922f77883e297b3d2478827a7a21e9.tar
craftbukkit-afb08bb0c5922f77883e297b3d2478827a7a21e9.tar.gz
craftbukkit-afb08bb0c5922f77883e297b3d2478827a7a21e9.tar.lz
craftbukkit-afb08bb0c5922f77883e297b3d2478827a7a21e9.tar.xz
craftbukkit-afb08bb0c5922f77883e297b3d2478827a7a21e9.zip
Account for time drifting backwards on servers with the moved too quickly check changes.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/net/minecraft/server/NetServerHandler.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java
index 01d605dd..6f484058 100644
--- a/src/main/java/net/minecraft/server/NetServerHandler.java
+++ b/src/main/java/net/minecraft/server/NetServerHandler.java
@@ -280,6 +280,9 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
// CraftBukkit start - make the movement speed check behave properly under tick degradation.
int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
+ if (elapsedTicks < 0) { // We should account for time drifting backwards
+ elapsedTicks = 1;
+ }
if (d8 > 100.0D * (elapsedTicks == 0 ? 1 : elapsedTicks)) {
a.warning(this.player.name + " moved too quickly! Elapsed ticks: " + (elapsedTicks == 0 ? 1 : elapsedTicks) + ", Distance change: " + d8);
this.disconnect("You moved too quickly :( (Hacking?)");