Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 21:10:17 +01:00
50 Zeilen
2.1 KiB
Diff
50 Zeilen
2.1 KiB
Diff
From c26229532d77b6504a398fd25e2a6c41721f4b42 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 6949979..dd41222 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;
|
|
@@ -201,6 +202,18 @@ public class PlayerConnection implements PacketPlayInListener {
|
|
|
|
// 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.
|
|
|
|
@@ -229,7 +242,7 @@ public class PlayerConnection implements PacketPlayInListener {
|
|
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);
|
|
|
|
--
|
|
1.8.5.2.msysgit.0
|
|
|