From 3f68b7f930dc4c3bf62dba67aa0d17d9bba938be 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. --- ...te-PlayerConnection-on-teleporting-p.patch | 36 +++++++++++++++++++ ...ate-PlayerConnection-on-world-change.patch | 34 ------------------ 2 files changed, 36 insertions(+), 34 deletions(-) create mode 100644 Spigot-Server-Patches/0133-SPIGOT-1903-Update-PlayerConnection-on-teleporting-p.patch delete mode 100644 Spigot-Server-Patches/0133-SPIGOT-1903-Update-PlayerConnection-on-world-change.patch diff --git a/Spigot-Server-Patches/0133-SPIGOT-1903-Update-PlayerConnection-on-teleporting-p.patch b/Spigot-Server-Patches/0133-SPIGOT-1903-Update-PlayerConnection-on-teleporting-p.patch new file mode 100644 index 0000000000..a48689443e --- /dev/null +++ b/Spigot-Server-Patches/0133-SPIGOT-1903-Update-PlayerConnection-on-teleporting-p.patch @@ -0,0 +1,36 @@ +From 307c4b55c0176a16ae15583641da73bfccbc5e4e 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 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 49e6661..fb5d84f 100644 +--- a/src/main/java/net/minecraft/server/Entity.java ++++ b/src/main/java/net/minecraft/server/Entity.java +@@ -288,6 +288,7 @@ 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 f0c04e5..d267a44 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -205,7 +205,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + + } + +- private void d() { ++ public void captureCurrentPosition() { d(); } private void d() { // Paper // OBFHELPER + this.l = this.player.locX; + this.m = this.player.locY; + this.n = this.player.locZ; +-- +2.8.1 + diff --git a/Spigot-Server-Patches/0133-SPIGOT-1903-Update-PlayerConnection-on-world-change.patch b/Spigot-Server-Patches/0133-SPIGOT-1903-Update-PlayerConnection-on-world-change.patch deleted file mode 100644 index 0ce6c53ddd..0000000000 --- a/Spigot-Server-Patches/0133-SPIGOT-1903-Update-PlayerConnection-on-world-change.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 77f4d31973ad9ff87d36f5d422d824eee7b38393 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 - - -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index f0c04e5..d267a44 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -205,7 +205,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - - } - -- private void d() { -+ public void captureCurrentPosition() { d(); } private void d() { // Paper // OBFHELPER - 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 94f122d..8842eb1 100644 ---- a/src/main/java/net/minecraft/server/PlayerList.java -+++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -653,6 +653,7 @@ 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); --- -2.8.1 -