Merge commit 'fc0619ee6e4fa08aba2719e58a9289edd11f0b6e'

# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/AddItemActorPacket.php
#	src/network/mcpe/protocol/AddPlayerPacket.php
#	src/network/mcpe/protocol/SetActorDataPacket.php
#	src/network/mcpe/serializer/NetworkBinaryStream.php
#	src/pocketmine/network/mcpe/protocol/AddActorPacket.php
#	src/pocketmine/network/mcpe/protocol/LoginPacket.php
This commit is contained in:
Dylan K. Taylor 2020-01-31 19:42:07 +00:00
commit 20d39846b7
6 changed files with 16 additions and 5 deletions

View File

@ -369,6 +369,9 @@ class AvailableCommandsPacket extends DataPacket implements ClientboundPacket{
}
}
/**
* @param string[] $postfixes
*/
private function argTypeToString(int $argtype, array $postfixes) : string{
if($argtype & self::ARG_FLAG_VALID){
if($argtype & self::ARG_FLAG_ENUM){

View File

@ -30,7 +30,7 @@ use pocketmine\network\mcpe\handler\PacketHandler;
class GameRulesChangedPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::GAME_RULES_CHANGED_PACKET;
/** @var array */
/** @var mixed[][] */
public $gameRules = [];
protected function decodePayload() : void{

View File

@ -56,6 +56,9 @@ class LevelChunkPacket extends DataPacket implements ClientboundPacket{
return $result;
}
/**
* @param int[] $usedBlobHashes
*/
public static function withCache(int $chunkX, int $chunkZ, int $subChunkCount, array $usedBlobHashes, string $extraPayload) : self{
(static function(int ...$hashes){})(...$usedBlobHashes);
$result = new self;

View File

@ -87,7 +87,7 @@ class LoginPacket extends DataPacket implements ServerboundPacket{
public $extraData = null;
/** @var string */
public $clientDataJwt;
/** @var array decoded payload of the clientData JWT */
/** @var mixed[] decoded payload of the clientData JWT */
public $clientData = [];
/**

View File

@ -103,7 +103,7 @@ class StartGamePacket extends DataPacket implements ClientboundPacket{
public $commandsEnabled;
/** @var bool */
public $isTexturePacksRequired = true;
/** @var array */
/** @var mixed[][] */
public $gameRules = [ //TODO: implement this
"naturalregeneration" => [1, false] //Hack for client side regeneration
];
@ -153,7 +153,7 @@ class StartGamePacket extends DataPacket implements ClientboundPacket{
/** @var ListTag|null */
public $blockTable = null;
/** @var array|null string (name) => int16 (legacyID) */
/** @var int[]|null string (name) => int16 (legacyID) */
public $itemTable = null;
protected function decodePayload() : void{
@ -300,6 +300,9 @@ class StartGamePacket extends DataPacket implements ClientboundPacket{
$this->putString($this->multiplayerCorrelationId);
}
/**
* @param int[] $table
*/
private static function serializeItemTable(array $table) : string{
$stream = new NetworkBinaryStream();
$stream->putUnsignedVarInt(count($table));

View File

@ -529,7 +529,7 @@ class NetworkBinaryStream extends BinaryStream{
* Reads gamerules
* TODO: implement this properly
*
* @return array, members are in the structure [name => [type, value]]
* @return mixed[][], members are in the structure [name => [type, value]]
*
* @throws BadPacketException
* @throws BinaryDataException
@ -564,6 +564,8 @@ class NetworkBinaryStream extends BinaryStream{
/**
* Writes a gamerule array, members should be in the structure [name => [type, value]]
* TODO: implement this properly
*
* @param mixed[][] $rules
*/
public function putGameRules(array $rules) : void{
$this->putUnsignedVarInt(count($rules));