mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
add some phpstan array types
This commit is contained in:
@ -163,7 +163,10 @@ class AddActorPacket extends DataPacket{
|
||||
|
||||
/** @var Attribute[] */
|
||||
public $attributes = [];
|
||||
/** @var mixed[][] */
|
||||
/**
|
||||
* @var mixed[][]
|
||||
* @phpstan-var array<int, array{0: int, 1: mixed}>
|
||||
*/
|
||||
public $metadata = [];
|
||||
/** @var EntityLink[] */
|
||||
public $links = [];
|
||||
|
@ -42,7 +42,10 @@ class AddItemActorPacket extends DataPacket{
|
||||
public $position;
|
||||
/** @var Vector3|null */
|
||||
public $motion;
|
||||
/** @var mixed[][] */
|
||||
/**
|
||||
* @var mixed[][]
|
||||
* @phpstan-var array<int, array{0: int, 1: mixed}>
|
||||
*/
|
||||
public $metadata = [];
|
||||
/** @var bool */
|
||||
public $isFromFishing = false;
|
||||
|
@ -57,7 +57,10 @@ class AddPlayerPacket extends DataPacket{
|
||||
public $headYaw = null; //TODO
|
||||
/** @var Item */
|
||||
public $item;
|
||||
/** @var mixed[][] */
|
||||
/**
|
||||
* @var mixed[][]
|
||||
* @phpstan-var array<int, array{0: int, 1: mixed}>
|
||||
*/
|
||||
public $metadata = [];
|
||||
|
||||
//TODO: adventure settings stuff
|
||||
|
@ -362,6 +362,7 @@ class AvailableCommandsPacket extends DataPacket{
|
||||
|
||||
/**
|
||||
* @param string[] $postfixes
|
||||
* @phpstan-param array<int, string> $postfixes
|
||||
*/
|
||||
private function argTypeToString(int $argtype, array $postfixes) : string{
|
||||
if($argtype & self::ARG_FLAG_VALID){
|
||||
|
@ -30,7 +30,10 @@ use pocketmine\network\mcpe\NetworkSession;
|
||||
class GameRulesChangedPacket extends DataPacket{
|
||||
public const NETWORK_ID = ProtocolInfo::GAME_RULES_CHANGED_PACKET;
|
||||
|
||||
/** @var mixed[][] */
|
||||
/**
|
||||
* @var mixed[][]
|
||||
* @phpstan-var array<string, array{0: int, 1: bool|int|float}>
|
||||
*/
|
||||
public $gameRules = [];
|
||||
|
||||
protected function decodePayload(){
|
||||
|
@ -54,11 +54,17 @@ class LoginPacket extends DataPacket{
|
||||
/** @var string */
|
||||
public $locale;
|
||||
|
||||
/** @var string[][] (the "chain" index contains one or more JWTs) */
|
||||
/**
|
||||
* @var string[][] (the "chain" index contains one or more JWTs)
|
||||
* @phpstan-var array{chain?: list<string>}
|
||||
*/
|
||||
public $chainData = [];
|
||||
/** @var string */
|
||||
public $clientDataJwt;
|
||||
/** @var mixed[] decoded payload of the clientData JWT */
|
||||
/**
|
||||
* @var mixed[] decoded payload of the clientData JWT
|
||||
* @phpstan-var array<string, mixed>
|
||||
*/
|
||||
public $clientData = [];
|
||||
|
||||
/**
|
||||
|
@ -32,7 +32,10 @@ class SetActorDataPacket extends DataPacket{
|
||||
|
||||
/** @var int */
|
||||
public $entityRuntimeId;
|
||||
/** @var mixed[][] */
|
||||
/**
|
||||
* @var mixed[][]
|
||||
* @phpstan-var array<int, array{0: int, 1: mixed}>
|
||||
*/
|
||||
public $metadata;
|
||||
|
||||
protected function decodePayload(){
|
||||
|
@ -102,7 +102,10 @@ class StartGamePacket extends DataPacket{
|
||||
public $commandsEnabled;
|
||||
/** @var bool */
|
||||
public $isTexturePacksRequired = true;
|
||||
/** @var mixed[][] */
|
||||
/**
|
||||
* @var mixed[][]
|
||||
* @phpstan-var array<string, array{0: int, 1: bool|int|float}>
|
||||
*/
|
||||
public $gameRules = [ //TODO: implement this
|
||||
"naturalregeneration" => [1, false] //Hack for client side regeneration
|
||||
];
|
||||
@ -152,7 +155,10 @@ class StartGamePacket extends DataPacket{
|
||||
|
||||
/** @var ListTag|null */
|
||||
public $blockTable = null;
|
||||
/** @var int[]|null string (name) => int16 (legacyID) */
|
||||
/**
|
||||
* @var int[]|null string (name) => int16 (legacyID)
|
||||
* @phpstan-var array<string, int>|null
|
||||
*/
|
||||
public $itemTable = null;
|
||||
|
||||
protected function decodePayload(){
|
||||
@ -301,6 +307,7 @@ class StartGamePacket extends DataPacket{
|
||||
|
||||
/**
|
||||
* @param int[] $table
|
||||
* @phpstan-param array<string, int> $table
|
||||
*/
|
||||
private static function serializeItemTable(array $table) : string{
|
||||
$stream = new NetworkBinaryStream();
|
||||
|
Reference in New Issue
Block a user