From e0b057c30ffba54a020034c5203185c6de73c3b8 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 12 Apr 2016 23:26:42 -0400 Subject: [PATCH] Update PlayerConnection for all teleportation of players Previous fix for SPIGOT-1903 only applied to world changes, but many other cases of players been teleporting can cause that same bug. So call it any time setPosition is called to ensure we never falsely trigger "moved too quickly" And this commit may be considered evil to some people. --- ...e-PlayerConnection-on-teleporting-p.patch} | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) rename Spigot-Server-Patches/{SPIGOT-1903-Update-PlayerConnection-on-world-change.patch => SPIGOT-1903-Update-PlayerConnection-on-teleporting-p.patch} (53%) diff --git a/Spigot-Server-Patches/SPIGOT-1903-Update-PlayerConnection-on-world-change.patch b/Spigot-Server-Patches/SPIGOT-1903-Update-PlayerConnection-on-teleporting-p.patch similarity index 53% rename from Spigot-Server-Patches/SPIGOT-1903-Update-PlayerConnection-on-world-change.patch rename to Spigot-Server-Patches/SPIGOT-1903-Update-PlayerConnection-on-teleporting-p.patch index cce9b713e..e4b98f52c 100644 --- a/Spigot-Server-Patches/SPIGOT-1903-Update-PlayerConnection-on-world-change.patch +++ b/Spigot-Server-Patches/SPIGOT-1903-Update-PlayerConnection-on-teleporting-p.patch @@ -1,9 +1,23 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 10 Apr 2016 22:36:10 -0400 -Subject: [PATCH] SPIGOT-1903: Update PlayerConnection on world change +Subject: [PATCH] SPIGOT-1903: Update PlayerConnection on teleporting players +Otherwise the player will trigger a "moved too quickly" next movement packet +and rubber band. +diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/Entity.java ++++ b/src/main/java/net/minecraft/server/Entity.java +@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener { + this.locX = d0; + this.locY = d1; + this.locZ = d2; ++ if (this instanceof EntityPlayer && ((EntityPlayer) this).playerConnection != null) ((EntityPlayer) this).playerConnection.captureCurrentPosition(); // Paper + float f = this.width / 2.0F; + float f1 = this.length; + diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java @@ -17,16 +31,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.l = this.player.locX; this.m = this.player.locY; this.n = this.player.locZ; -diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/PlayerList.java -+++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -0,0 +0,0 @@ public abstract class PlayerList { - } - WorldServer worldserver = ((CraftWorld) location.getWorld()).getHandle(); - entityplayer1.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); -+ entityplayer1.playerConnection.captureCurrentPosition(); // Paper - // CraftBukkit end - - worldserver.getChunkProviderServer().getChunkAt((int) entityplayer1.locX >> 4, (int) entityplayer1.locZ >> 4); -- \ No newline at end of file