From b0775e3e0cfa45750db0e33358f3517225c4e9f1 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 13 Jun 2014 21:59:10 +0200 Subject: [PATCH] Fixed EntityMoveEvent cancellation for Player --- src/pocketmine/Player.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 31f2b8225..f0bf86227 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -68,6 +68,7 @@ use pocketmine\network\protocol\FullChunkDataPacket; use pocketmine\network\protocol\Info as ProtocolInfo; use pocketmine\network\protocol\LoginStatusPacket; use pocketmine\network\protocol\MessagePacket; +use pocketmine\network\protocol\MovePlayerPacket; use pocketmine\network\protocol\ReadyPacket; use pocketmine\network\protocol\SetSpawnPositionPacket; use pocketmine\network\protocol\SetTimePacket; @@ -1247,7 +1248,17 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ $this->server->getLogger()->warning($this->username." moved too quickly!"); } }else{*/ - $this->setPositionAndRotation($newPos, $packet->yaw, $packet->pitch); + if(!$this->setPositionAndRotation($newPos, $packet->yaw, $packet->pitch)){ + $pk = new MovePlayerPacket(); + $pk->eid = 0; + $pk->x = $this->x; + $pk->y = $this->y; + $pk->z = $this->z; + $pk->bodyYaw = $this->yaw; + $pk->pitch = $this->pitch; + $pk->yaw = $this->yaw; + $this->directDataPacket($pk); + } //} break;