mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 11:16:57 +00:00
Merge branch 'api3/network_mcpe-1.0.5' into api3/network
This commit is contained in:
@ -114,10 +114,12 @@ use pocketmine\network\mcpe\protocol\AnimatePacket;
|
||||
use pocketmine\network\mcpe\protocol\AvailableCommandsPacket;
|
||||
use pocketmine\network\mcpe\protocol\BlockEntityDataPacket;
|
||||
use pocketmine\network\mcpe\protocol\BlockEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\BlockPickRequestPacket;
|
||||
use pocketmine\network\mcpe\protocol\ChangeDimensionPacket;
|
||||
use pocketmine\network\mcpe\protocol\ChunkRadiusUpdatedPacket;
|
||||
use pocketmine\network\mcpe\protocol\ClientboundMapItemDataPacket;
|
||||
use pocketmine\network\mcpe\protocol\ClientToServerHandshakePacket;
|
||||
use pocketmine\network\mcpe\protocol\CommandBlockUpdatePacket;
|
||||
use pocketmine\network\mcpe\protocol\CommandStepPacket;
|
||||
use pocketmine\network\mcpe\protocol\ContainerClosePacket;
|
||||
use pocketmine\network\mcpe\protocol\ContainerOpenPacket;
|
||||
@ -149,6 +151,7 @@ use pocketmine\network\mcpe\protocol\PlayerActionPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlayerFallPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlayerInputPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlayerListPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlaySoundPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlayStatusPacket;
|
||||
use pocketmine\network\mcpe\protocol\ProtocolInfo;
|
||||
use pocketmine\network\mcpe\protocol\RemoveBlockPacket;
|
||||
@ -173,9 +176,11 @@ use pocketmine\network\mcpe\protocol\SetHealthPacket;
|
||||
use pocketmine\network\mcpe\protocol\SetPlayerGameTypePacket;
|
||||
use pocketmine\network\mcpe\protocol\SetSpawnPositionPacket;
|
||||
use pocketmine\network\mcpe\protocol\SetTimePacket;
|
||||
use pocketmine\network\mcpe\protocol\SetTitlePacket;
|
||||
use pocketmine\network\mcpe\protocol\ShowCreditsPacket;
|
||||
use pocketmine\network\mcpe\protocol\SpawnExperienceOrbPacket;
|
||||
use pocketmine\network\mcpe\protocol\StartGamePacket;
|
||||
use pocketmine\network\mcpe\protocol\StopSoundPacket;
|
||||
use pocketmine\network\mcpe\protocol\TakeItemEntityPacket;
|
||||
use pocketmine\network\mcpe\protocol\TextPacket;
|
||||
use pocketmine\network\mcpe\protocol\TransferPacket;
|
||||
@ -1677,15 +1682,6 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
|
||||
$this->timings->stopTiming();
|
||||
|
||||
//TODO: remove this workaround (broken client MCPE 1.0.0)
|
||||
if(count($this->messageQueue) > 0){
|
||||
$pk = new TextPacket();
|
||||
$pk->type = TextPacket::TYPE_RAW;
|
||||
$pk->message = implode("\n", $this->messageQueue);
|
||||
$this->dataPacket($pk);
|
||||
$this->messageQueue = [];
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2007,6 +2003,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
case ResourcePackClientResponsePacket::STATUS_COMPLETED:
|
||||
$this->completeLoginSequence();
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -2093,10 +2091,6 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
public function handleMovePlayer(MovePlayerPacket $packet) : bool{
|
||||
$newPos = new Vector3($packet->x, $packet->y - $this->getEyeHeight(), $packet->z);
|
||||
|
||||
if($newPos->distanceSquared($this) == 0 and ($packet->yaw % 360) === $this->yaw and ($packet->pitch % 360) === $this->pitch){ //player hasn't moved, just client spamming packets
|
||||
return true;
|
||||
}
|
||||
|
||||
$revert = false;
|
||||
if(!$this->isAlive() or $this->spawned !== true){
|
||||
$revert = true;
|
||||
@ -2393,6 +2387,10 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
return true;
|
||||
}
|
||||
|
||||
public function handleBlockPickRequest(BlockPickRequestPacket $packet) : bool{
|
||||
return false; //TODO
|
||||
}
|
||||
|
||||
public function handleUseItem(UseItemPacket $packet) : bool{
|
||||
if($this->spawned === false or !$this->isAlive()){
|
||||
return true;
|
||||
@ -3250,6 +3248,10 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
return true;
|
||||
}
|
||||
|
||||
public function handleCommandBlockUpdate(CommandBlockUpdatePacket $packet) : bool{
|
||||
return false; //TODO
|
||||
}
|
||||
|
||||
public function handleUpdateTrade(UpdateTradePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
@ -3285,6 +3287,18 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handlePlaySound(PlaySoundPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleStopSound(StopSoundPacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleSetTitle(SetTitlePacket $packet) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleUnknown(UnknownPacket $packet) : bool{
|
||||
$this->server->getLogger()->debug("Received unknown packet from " . $this->getName() . ": 0x" . bin2hex($packet->payload));
|
||||
return true;
|
||||
@ -3371,9 +3385,6 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @var string[] */
|
||||
private $messageQueue = [];
|
||||
|
||||
/**
|
||||
* Sends a direct chat message to a player
|
||||
*
|
||||
@ -3388,14 +3399,10 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$message = $message->getText();
|
||||
}
|
||||
|
||||
//TODO: Remove this workaround (broken client MCPE 1.0.0)
|
||||
$this->messageQueue[] = $this->server->getLanguage()->translateString($message);
|
||||
/*
|
||||
$pk = new TextPacket();
|
||||
$pk->type = TextPacket::TYPE_RAW;
|
||||
$pk->message = $this->server->getLanguage()->translateString($message);
|
||||
$this->dataPacket($pk);
|
||||
*/
|
||||
}
|
||||
|
||||
public function sendTranslation($message, array $parameters = []){
|
||||
|
Reference in New Issue
Block a user