Better way of doing this without making plugins angry
By: md_5 <md_5@live.com.au>
This commit is contained in:
@@ -1,22 +1,39 @@
|
||||
From 89f9c8f06dbe1b36214500b30a2db3b5383f03c5 Mon Sep 17 00:00:00 2001
|
||||
From 84cf8a6a6899e1915dbbd49ec862018ed4749871 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 10d853b..4117942 100644
|
||||
index 10d853b..fbba359 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -222,7 +222,7 @@ public class PlayerConnection extends Connection {
|
||||
@@ -96,6 +96,7 @@ public class PlayerConnection extends Connection {
|
||||
private float lastPitch = Float.MAX_VALUE;
|
||||
private float lastYaw = Float.MAX_VALUE;
|
||||
private boolean justTeleported = false;
|
||||
+ private boolean hasMoved; // Spigot
|
||||
|
||||
// For the packet15 hack :(
|
||||
Long lastPacket;
|
||||
@@ -222,7 +223,7 @@ public class PlayerConnection extends Connection {
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
// Skip the first time we do this
|
||||
- if (from.getX() != Double.MAX_VALUE) {
|
||||
+ if (true) { // Spigot - no special cases!
|
||||
+ if (hasMoved) { // Spigot - Better Check!
|
||||
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||
this.server.getPluginManager().callEvent(event);
|
||||
|
||||
@@ -246,7 +247,7 @@ public class PlayerConnection extends Connection {
|
||||
this.justTeleported = false;
|
||||
return;
|
||||
}
|
||||
- }
|
||||
+ } else { hasMoved = true; } // Spigot - Better Check!
|
||||
}
|
||||
|
||||
if (Double.isNaN(packet10flying.x) || Double.isNaN(packet10flying.y) || Double.isNaN(packet10flying.z) || Double.isNaN(packet10flying.stance)) {
|
||||
--
|
||||
1.8.1.2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user