mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 02:10:30 +01:00
c7f1eed0bf
3beb7729816 a77ed5758a7 52c130fc6d9
50 lines
2.3 KiB
Diff
50 lines
2.3 KiB
Diff
From 51b6f158ded3214ccf521aab307d58fac43d68e2 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 65dd171..96e025d 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
@@ -108,6 +108,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
|
|
private float lastPitch = Float.MAX_VALUE;
|
|
private float lastYaw = Float.MAX_VALUE;
|
|
private boolean justTeleported = false;
|
|
+ private boolean hasMoved; // Spigot
|
|
|
|
public CraftPlayer getPlayer() {
|
|
return (this.player == null) ? null : (CraftPlayer) this.player.getBukkitEntity();
|
|
@@ -209,6 +210,18 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
|
|
}
|
|
// CraftBukkit start - fire PlayerMoveEvent
|
|
Player player = this.getPlayer();
|
|
+ // Spigot Start
|
|
+ if ( !hasMoved )
|
|
+ {
|
|
+ Location curPos = player.getLocation();
|
|
+ lastPosX = curPos.getX();
|
|
+ lastPosY = curPos.getY();
|
|
+ lastPosZ = curPos.getZ();
|
|
+ lastYaw = curPos.getYaw();
|
|
+ lastPitch = curPos.getPitch();
|
|
+ hasMoved = true;
|
|
+ }
|
|
+ // Spigot End
|
|
Location from = new Location(player.getWorld(), lastPosX, lastPosY, lastPosZ, lastYaw, lastPitch); // Get the Players previous Event location.
|
|
Location to = player.getLocation().clone(); // Start off the To location as the Players current location.
|
|
|
|
@@ -237,7 +250,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
|
|
this.lastPitch = to.getPitch();
|
|
|
|
// Skip the first time we do this
|
|
- if (from.getX() != Double.MAX_VALUE) {
|
|
+ if (true) { // Spigot - don't skip any move events
|
|
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
|
this.server.getPluginManager().callEvent(event);
|
|
|
|
--
|
|
2.1.0
|
|
|