From 839033282650bfe93c50dbc9179e1c9d3143fc5c Mon Sep 17 00:00:00 2001 From: Saxavlax001 Date: Wed, 23 Jan 2019 00:43:55 +0200 Subject: [PATCH] Add support for PureChat plugin --- src/pocketmine/Player.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 547e87903..db98eab78 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -2175,9 +2175,11 @@ public function handleDataPacket(DataPacket $packet){ if($message != "" and strlen($message) <= 255 and $this->messageCounter-- > 0){ $this->server->getPluginManager()->callEvent($ev = new PlayerChatEvent($this, $message)); if(!$ev->isCancelled()){ - $this->server->broadcastMessage($ev->getPlayer()->getDisplayName() . ": " . $ev->getMessage(), $ev->getRecipients()); - } - } + + $this->server->broadcastMessage($ev->getFormat(), $ev->getPlayer()->getDisplayName(), $ev->getMessage(), $ev->getRecipients()); + } + } + return true; } } else { echo "Recive message with type ".$packet->type.PHP_EOL; @@ -2191,7 +2193,7 @@ public function handleDataPacket(DataPacket $packet){ } $this->craftingType = self::CRAFTING_DEFAULT; $this->currentTransaction = null; - // @todo добавить обычный инвентарь и броню + // @todo      if ($packet->windowid === $this->currentWindowId && $this->currentWindow != null) { $this->server->getPluginManager()->callEvent(new InventoryCloseEvent($this->currentWindow, $this)); $this->removeWindow($this->currentWindow); @@ -2266,7 +2268,7 @@ public function handleDataPacket(DataPacket $packet){ return; } - // переделать эту проверку + //   if ($recipe === null || (($recipe instanceof BigShapelessRecipe || $recipe instanceof BigShapedRecipe) && $this->craftingType === self::CRAFTING_DEFAULT)) { $this->inventory->sendContents($this); //Timings::$timerCraftingEventPacket->stopTiming();