Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 21:10:17 +01:00
40 Zeilen
1.7 KiB
Diff
40 Zeilen
1.7 KiB
Diff
|
From 7ed621bde6fe42a653b6b9469d9336ac66f9368c Mon Sep 17 00:00:00 2001
|
||
|
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 6e54ad1..e88adfa 100644
|
||
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||
|
@@ -105,6 +105,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
|
||
|
|
||
|
// For the PacketPlayOutBlockPlace hack :(
|
||
|
Long lastPacket;
|
||
|
@@ -222,7 +223,7 @@ public class PlayerConnection implements PacketPlayInListener {
|
||
|
this.lastPitch = to.getPitch();
|
||
|
|
||
|
// Skip the first time we do this
|
||
|
- if (from.getX() != Double.MAX_VALUE) {
|
||
|
+ if (hasMoved) { // Spigot - Better Check!
|
||
|
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||
|
this.server.getPluginManager().callEvent(event);
|
||
|
|
||
|
@@ -246,7 +247,7 @@ public class PlayerConnection implements PacketPlayInListener {
|
||
|
this.justTeleported = false;
|
||
|
return;
|
||
|
}
|
||
|
- }
|
||
|
+ } else { hasMoved = true; } // Spigot - Better Check!
|
||
|
}
|
||
|
|
||
|
if (Double.isNaN(packetplayinflying.x) || Double.isNaN(packetplayinflying.y) || Double.isNaN(packetplayinflying.z) || Double.isNaN(packetplayinflying.stance)) {
|
||
|
--
|
||
|
1.8.3.2
|
||
|
|