2016-03-04 04:26:28 +00:00
|
|
|
From 6b7a7a6b1dc6e05c2b53899a4cca7e0b9f45c682 Mon Sep 17 00:00:00 2001
|
2014-07-21 20:46: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
|
2016-03-04 04:26:28 +00:00
|
|
|
index 0f96a20..dda3d8c 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2016-03-04 04:26:28 +00:00
|
|
|
@@ -125,6 +125,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
2014-07-21 20:46:54 +00:00
|
|
|
private float lastPitch = Float.MAX_VALUE;
|
|
|
|
private float lastYaw = Float.MAX_VALUE;
|
|
|
|
private boolean justTeleported = false;
|
|
|
|
+ private boolean hasMoved; // Spigot
|
|
|
|
|
2014-11-29 00:06:26 +00:00
|
|
|
public CraftPlayer getPlayer() {
|
|
|
|
return (this.player == null) ? null : (CraftPlayer) this.player.getBukkitEntity();
|
2016-03-04 04:26:28 +00:00
|
|
|
@@ -325,6 +326,18 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
2016-02-29 21:33:06 +00:00
|
|
|
|
2015-05-22 13:52:56 +00:00
|
|
|
// 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.
|
2014-07-21 20:46:54 +00:00
|
|
|
|
2016-03-04 04:26:28 +00:00
|
|
|
@@ -350,7 +363,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
2015-05-22 13:52:56 +00:00
|
|
|
this.lastPitch = to.getPitch();
|
2014-07-21 20:46:54 +00:00
|
|
|
|
2015-05-22 13:52:56 +00:00
|
|
|
// Skip the first time we do this
|
|
|
|
- if (from.getX() != Double.MAX_VALUE) {
|
|
|
|
+ if (true) { // Spigot - don't skip any move events
|
|
|
|
Location oldTo = to.clone();
|
|
|
|
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
|
|
|
this.server.getPluginManager().callEvent(event);
|
2014-07-21 20:46:54 +00:00
|
|
|
--
|
2016-02-29 21:33:06 +00:00
|
|
|
2.5.0
|
2014-07-21 20:46:54 +00:00
|
|
|
|