From 57a86d9ed7ed9cfa0a785e536b6c28c1a259ff8c Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 20 Jul 2018 12:39:48 +0100 Subject: [PATCH] Player: remove useless InteractPacket handler all the things we cared about in here don't exist anymore, so there's no sense in the handler still existing. It can be restored when we want to use the things it still does. --- src/pocketmine/Player.php | 26 ------------------- .../mcpe/handler/SimpleSessionHandler.php | 2 +- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 986faf486..5910c3f2e 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -106,7 +106,6 @@ use pocketmine\network\mcpe\protocol\BookEditPacket; use pocketmine\network\mcpe\protocol\ChunkRadiusUpdatedPacket; use pocketmine\network\mcpe\protocol\DataPacket; use pocketmine\network\mcpe\protocol\EntityEventPacket; -use pocketmine\network\mcpe\protocol\InteractPacket; use pocketmine\network\mcpe\protocol\InventoryTransactionPacket; use pocketmine\network\mcpe\protocol\ItemFrameDropItemPacket; use pocketmine\network\mcpe\protocol\LevelEventPacket; @@ -2625,31 +2624,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ return true; } - public function handleInteract(InteractPacket $packet) : bool{ - if(!$this->spawned or !$this->isAlive()){ - return true; - } - - $this->doCloseInventory(); - - $target = $this->level->getEntity($packet->target); - if($target === null){ - return false; - } - - switch($packet->action){ - case InteractPacket::ACTION_LEAVE_VEHICLE: - case InteractPacket::ACTION_MOUSEOVER: - break; //TODO: handle these - default: - $this->server->getLogger()->debug("Unhandled/unknown interaction type " . $packet->action . "received from " . $this->getName()); - - return false; - } - - return true; - } - public function handleBlockPickRequest(BlockPickRequestPacket $packet) : bool{ $block = $this->level->getBlockAt($packet->blockX, $packet->blockY, $packet->blockZ); diff --git a/src/pocketmine/network/mcpe/handler/SimpleSessionHandler.php b/src/pocketmine/network/mcpe/handler/SimpleSessionHandler.php index 1e8ede160..b640192bb 100644 --- a/src/pocketmine/network/mcpe/handler/SimpleSessionHandler.php +++ b/src/pocketmine/network/mcpe/handler/SimpleSessionHandler.php @@ -122,7 +122,7 @@ class SimpleSessionHandler extends SessionHandler{ } public function handleInteract(InteractPacket $packet) : bool{ - return $this->player->handleInteract($packet); + return false; //TODO } public function handleBlockPickRequest(BlockPickRequestPacket $packet) : bool{