mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-18 03:35:33 +00:00
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:
commit
20d39846b7
@ -369,6 +369,9 @@ class AvailableCommandsPacket extends DataPacket implements ClientboundPacket{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string[] $postfixes
|
||||||
|
*/
|
||||||
private function argTypeToString(int $argtype, array $postfixes) : string{
|
private function argTypeToString(int $argtype, array $postfixes) : string{
|
||||||
if($argtype & self::ARG_FLAG_VALID){
|
if($argtype & self::ARG_FLAG_VALID){
|
||||||
if($argtype & self::ARG_FLAG_ENUM){
|
if($argtype & self::ARG_FLAG_ENUM){
|
||||||
|
@ -30,7 +30,7 @@ use pocketmine\network\mcpe\handler\PacketHandler;
|
|||||||
class GameRulesChangedPacket extends DataPacket implements ClientboundPacket{
|
class GameRulesChangedPacket extends DataPacket implements ClientboundPacket{
|
||||||
public const NETWORK_ID = ProtocolInfo::GAME_RULES_CHANGED_PACKET;
|
public const NETWORK_ID = ProtocolInfo::GAME_RULES_CHANGED_PACKET;
|
||||||
|
|
||||||
/** @var array */
|
/** @var mixed[][] */
|
||||||
public $gameRules = [];
|
public $gameRules = [];
|
||||||
|
|
||||||
protected function decodePayload() : void{
|
protected function decodePayload() : void{
|
||||||
|
@ -56,6 +56,9 @@ class LevelChunkPacket extends DataPacket implements ClientboundPacket{
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int[] $usedBlobHashes
|
||||||
|
*/
|
||||||
public static function withCache(int $chunkX, int $chunkZ, int $subChunkCount, array $usedBlobHashes, string $extraPayload) : self{
|
public static function withCache(int $chunkX, int $chunkZ, int $subChunkCount, array $usedBlobHashes, string $extraPayload) : self{
|
||||||
(static function(int ...$hashes){})(...$usedBlobHashes);
|
(static function(int ...$hashes){})(...$usedBlobHashes);
|
||||||
$result = new self;
|
$result = new self;
|
||||||
|
@ -87,7 +87,7 @@ class LoginPacket extends DataPacket implements ServerboundPacket{
|
|||||||
public $extraData = null;
|
public $extraData = null;
|
||||||
/** @var string */
|
/** @var string */
|
||||||
public $clientDataJwt;
|
public $clientDataJwt;
|
||||||
/** @var array decoded payload of the clientData JWT */
|
/** @var mixed[] decoded payload of the clientData JWT */
|
||||||
public $clientData = [];
|
public $clientData = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -103,7 +103,7 @@ class StartGamePacket extends DataPacket implements ClientboundPacket{
|
|||||||
public $commandsEnabled;
|
public $commandsEnabled;
|
||||||
/** @var bool */
|
/** @var bool */
|
||||||
public $isTexturePacksRequired = true;
|
public $isTexturePacksRequired = true;
|
||||||
/** @var array */
|
/** @var mixed[][] */
|
||||||
public $gameRules = [ //TODO: implement this
|
public $gameRules = [ //TODO: implement this
|
||||||
"naturalregeneration" => [1, false] //Hack for client side regeneration
|
"naturalregeneration" => [1, false] //Hack for client side regeneration
|
||||||
];
|
];
|
||||||
@ -153,7 +153,7 @@ class StartGamePacket extends DataPacket implements ClientboundPacket{
|
|||||||
|
|
||||||
/** @var ListTag|null */
|
/** @var ListTag|null */
|
||||||
public $blockTable = null;
|
public $blockTable = null;
|
||||||
/** @var array|null string (name) => int16 (legacyID) */
|
/** @var int[]|null string (name) => int16 (legacyID) */
|
||||||
public $itemTable = null;
|
public $itemTable = null;
|
||||||
|
|
||||||
protected function decodePayload() : void{
|
protected function decodePayload() : void{
|
||||||
@ -300,6 +300,9 @@ class StartGamePacket extends DataPacket implements ClientboundPacket{
|
|||||||
$this->putString($this->multiplayerCorrelationId);
|
$this->putString($this->multiplayerCorrelationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int[] $table
|
||||||
|
*/
|
||||||
private static function serializeItemTable(array $table) : string{
|
private static function serializeItemTable(array $table) : string{
|
||||||
$stream = new NetworkBinaryStream();
|
$stream = new NetworkBinaryStream();
|
||||||
$stream->putUnsignedVarInt(count($table));
|
$stream->putUnsignedVarInt(count($table));
|
||||||
|
@ -529,7 +529,7 @@ class NetworkBinaryStream extends BinaryStream{
|
|||||||
* Reads gamerules
|
* Reads gamerules
|
||||||
* TODO: implement this properly
|
* 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 BadPacketException
|
||||||
* @throws BinaryDataException
|
* @throws BinaryDataException
|
||||||
@ -564,6 +564,8 @@ class NetworkBinaryStream extends BinaryStream{
|
|||||||
/**
|
/**
|
||||||
* Writes a gamerule array, members should be in the structure [name => [type, value]]
|
* Writes a gamerule array, members should be in the structure [name => [type, value]]
|
||||||
* TODO: implement this properly
|
* TODO: implement this properly
|
||||||
|
*
|
||||||
|
* @param mixed[][] $rules
|
||||||
*/
|
*/
|
||||||
public function putGameRules(array $rules) : void{
|
public function putGameRules(array $rules) : void{
|
||||||
$this->putUnsignedVarInt(count($rules));
|
$this->putUnsignedVarInt(count($rules));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user