PaperMC/Spigot-Server-Patches/0126-SPIGOT-1903-Update-PlayerConnection-on-teleporting-p.patch

37 lines
1.5 KiB
Diff
Raw Normal View History

2016-06-09 05:57:14 +02:00
From d111aad2241cf5bb659fde0f464392e3845c445b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
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
2016-06-09 05:57:14 +02:00
index 61d7605..a3b8cfb 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
2016-06-09 05:57:14 +02:00
@@ -292,6 +292,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
2016-06-09 05:57:14 +02:00
index 9d595dc..f517c6a 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
2016-05-12 04:07:46 +02:00
@@ -204,7 +204,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;
--
2016-06-09 05:57:14 +02:00
2.8.3