papermc/CraftBukkit-Patches/0060-Don-t-Special-Case-X-Move-Value.patch

40 lines
1.7 KiB
Diff
Raw Normal View History

From da2c4dcf1043656220387aef2485bce94d41cbf1 Mon Sep 17 00:00:00 2001
2013-10-06 06:37:54 +00:00
From: md_5 <md_5@live.com.au>
Date: Sun, 6 Oct 2013 17:36:28 +1100
Subject: [PATCH] Don't Special Case X Move Value
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index e35e7a8..5534bc3 100644
2013-10-06 06:37:54 +00:00
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
2013-12-01 03:40:53 +00:00
@@ -102,6 +102,7 @@ public class PlayerConnection implements PacketPlayInListener {
private float lastPitch = Float.MAX_VALUE;
private float lastYaw = Float.MAX_VALUE;
private boolean justTeleported = false;
+ private boolean hasMoved; // Spigot
2013-12-01 03:40:53 +00:00
// For the PacketPlayOutBlockPlace hack :(
Long lastPacket;
@@ -219,7 +220,7 @@ public class PlayerConnection implements PacketPlayInListener {
2013-10-06 06:37:54 +00:00
this.lastPitch = to.getPitch();
// Skip the first time we do this
- if (from.getX() != Double.MAX_VALUE) {
+ if (hasMoved) { // Spigot - Better Check!
2013-10-06 06:37:54 +00:00
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
this.server.getPluginManager().callEvent(event);
@@ -243,7 +244,7 @@ public class PlayerConnection implements PacketPlayInListener {
this.justTeleported = false;
return;
}
- }
+ } else { hasMoved = true; } // Spigot - Better Check!
}
2013-12-01 03:40:53 +00:00
if (Double.isNaN(packetplayinflying.x) || Double.isNaN(packetplayinflying.y) || Double.isNaN(packetplayinflying.z) || Double.isNaN(packetplayinflying.stance)) {
2013-10-06 06:37:54 +00:00
--
2013-12-01 03:40:53 +00:00
1.8.3.2
2013-10-06 06:37:54 +00:00