From 31caee5a947d439f886602469c855ed56c5a1c48 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Thu, 3 Mar 2016 11:15:04 +0000 Subject: SPIGOT-1646: Capture the previous location earlier --- nms-patches/PlayerConnection.patch | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch index bb668cc2..26a609ca 100644 --- a/nms-patches/PlayerConnection.patch +++ b/nms-patches/PlayerConnection.patch @@ -235,7 +235,7 @@ this.minecraftServer.getPlayerList().d(this.player); this.player.checkMovement(this.player.locX - d0, this.player.locY - d1, this.player.locZ - d2); this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && !worldserver.d(entity.getBoundingBox().g(0.0625D).a(0.0D, -0.55D, 0.0D)); -@@ -273,12 +422,13 @@ +@@ -273,13 +422,21 @@ this.A = this.e; this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch); } @@ -248,9 +248,17 @@ this.minecraftServer.getPlayerList().d(this.player); + this.allowedPlayerTicks = 20; // CraftBukkit } else { ++ // CraftBukkit - Make sure the move is valid but then reset it for plugins to modify ++ double prevX = player.locX; ++ double prevY = player.locY; ++ double prevZ = player.locZ; ++ float prevYaw = player.yaw; ++ float prevPitch = player.pitch; ++ // CraftBukkit end double d0 = this.player.locX; double d1 = this.player.locY; -@@ -298,15 +448,32 @@ + double d2 = this.player.locZ; +@@ -298,15 +455,32 @@ ++this.F; int i = this.F - this.G; @@ -285,20 +293,6 @@ PlayerConnection.LOGGER.warn(this.player.getName() + " moved too quickly! " + d7 + "," + d8 + "," + d9); this.a(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch); return; -@@ -341,6 +508,13 @@ - PlayerConnection.LOGGER.warn(this.player.getName() + " moved wrongly!"); - } - -+ // CraftBukkit - Make sure the move is valid but then reset it for plugins to modify -+ double prevX = player.locX; -+ double prevY = player.locY; -+ double prevZ = player.locZ; -+ float prevYaw = player.yaw; -+ float prevPitch = player.pitch; -+ // CraftBukkit end - this.player.setLocation(d4, d5, d6, f, f1); - this.player.checkMovement(this.player.locX - d0, this.player.locY - d1, this.player.locZ - d2); - if (!this.player.noclip && !this.player.isSleeping()) { @@ -352,6 +526,69 @@ } } -- cgit v1.2.3