From 7ba7eaf303fbd69ffaf9cd473098c13a3978e769 Mon Sep 17 00:00:00 2001 From: PEMapModder Date: Tue, 23 Feb 2016 21:05:59 +0800 Subject: [PATCH] Fixed wrong InteractPacket constants Thanks @thebigsmileXD --- src/pocketmine/Player.php | 3 +++ src/pocketmine/network/protocol/InteractPacket.php | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 09720b629..4c9040007 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -2300,6 +2300,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade $cancelled = false; + echo "Packet data:\n"; + var_dump($packet->target, $packet->action); + if($packet->action === InteractPacket::ACTION_RIGHT_CLICK){ // TODO handle break; diff --git a/src/pocketmine/network/protocol/InteractPacket.php b/src/pocketmine/network/protocol/InteractPacket.php index 252aa0e2e..58f5a8067 100644 --- a/src/pocketmine/network/protocol/InteractPacket.php +++ b/src/pocketmine/network/protocol/InteractPacket.php @@ -27,8 +27,10 @@ namespace pocketmine\network\protocol; class InteractPacket extends DataPacket{ const NETWORK_ID = Info::INTERACT_PACKET; - const ACTION_LEFT_CLICK = 1; - const ACTION_RIGHT_CLICK = 2; + const ACTION_RIGHT_CLICK = 1; + const ACTION_LEFT_CLICK = 2; + const ACTION_LEAVE_VEHICLE = 3; + /** @deprecated Do NOT use this. This constant is misleading and will be removed in the future */ const ACTION_JUMP = 3; public $action;