mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-09-18 21:33:01 +00:00
56 lines
2.7 KiB
Diff
56 lines
2.7 KiB
Diff
From d9d99d140b9f6963e002f2936c91b06087b407aa 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 cc21ca5bb..d8a2e5582 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
@@ -127,6 +127,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
|
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();
|
|
@@ -367,6 +368,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
|
flag1 = true;
|
|
PlayerConnection.LOGGER.warn("{} moved wrongly!", entity.getDisplayName().getString());
|
|
}
|
|
+ Location curPos = this.getPlayer().getLocation(); // Spigot
|
|
|
|
entity.setLocation(d3, d4, d5, f, f1);
|
|
player.setLocation(d3, d4, d5, this.player.yaw, this.player.pitch); // CraftBukkit
|
|
@@ -381,6 +383,17 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
|
|
|
// CraftBukkit start - fire PlayerMoveEvent
|
|
Player player = this.getPlayer();
|
|
+ // Spigot Start
|
|
+ if ( !hasMoved )
|
|
+ {
|
|
+ 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.
|
|
|
|
@@ -406,7 +419,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
|
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
|
|
Location oldTo = to.clone();
|
|
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
|
this.server.getPluginManager().callEvent(event);
|
|
--
|
|
2.20.1
|
|
|