Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/pocketmine/Player.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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();
Expand Down