PocketMine-MP 5.37.4 git-dbb3eefc44d5dddb20f540594fbda61467f50873
Loading...
Searching...
No Matches
pocketmine\network\mcpe\protocol\serializer\CommonTypes Class Reference
+ Collaboration diagram for pocketmine\network\mcpe\protocol\serializer\CommonTypes:

Static Public Member Functions

static getActorRuntimeId (ByteBufferReader $in)
 
static getActorUniqueId (ByteBufferReader $in)
 
static getBlockPosition (ByteBufferReader $in)
 
static getBool (ByteBufferReader $in)
 
static getCommandOriginData (ByteBufferReader $in)
 
static getEntityLink (ByteBufferReader $in)
 
static getEntityMetadata (ByteBufferReader $in)
 
static getGameRules (ByteBufferReader $in, bool $isStartGame)
 
static getItemStackWithoutStackId (ByteBufferReader $in)
 
static getItemStackWrapper (ByteBufferReader $in)
 
static getNbtCompoundRoot (ByteBufferReader $in)
 
static getNbtRoot (ByteBufferReader $in)
 
static getRecipeIngredient (ByteBufferReader $in)
 
static getRotationByte (ByteBufferReader $in)
 
static getSignedBlockPosition (ByteBufferReader $in)
 
static getSkin (ByteBufferReader $in)
 
static getString (ByteBufferReader $in)
 
static getStructureEditorData (ByteBufferReader $in)
 
static getStructureSettings (ByteBufferReader $in)
 
static getUUID (ByteBufferReader $in)
 
static getVector2 (ByteBufferReader $in)
 
static getVector3 (ByteBufferReader $in)
 
static putActorRuntimeId (ByteBufferWriter $out, int $eid)
 
static putActorUniqueId (ByteBufferWriter $out, int $eid)
 
static putBlockPosition (ByteBufferWriter $out, BlockPosition $blockPosition)
 
static putBool (ByteBufferWriter $out, bool $v)
 
static putCommandOriginData (ByteBufferWriter $out, CommandOriginData $data)
 
static putEntityLink (ByteBufferWriter $out, EntityLink $link)
 
static putEntityMetadata (ByteBufferWriter $out, array $metadata)
 
static putGameRules (ByteBufferWriter $out, array $rules, bool $isStartGame)
 
static putItemStackWithoutStackId (ByteBufferWriter $out, ItemStack $itemStack)
 
static putItemStackWrapper (ByteBufferWriter $out, ItemStackWrapper $itemStackWrapper)
 
static putRecipeIngredient (ByteBufferWriter $out, RecipeIngredient $ingredient)
 
static putRotationByte (ByteBufferWriter $out, float $rotation)
 
static putSignedBlockPosition (ByteBufferWriter $out, BlockPosition $blockPosition)
 
static putSkin (ByteBufferWriter $out, SkinData $skin)
 
static putString (ByteBufferWriter $out, string $v)
 
static putStructureEditorData (ByteBufferWriter $out, StructureEditorData $structureEditorData)
 
static putStructureSettings (ByteBufferWriter $out, StructureSettings $structureSettings)
 
static putUUID (ByteBufferWriter $out, UuidInterface $uuid)
 
static putVector2 (ByteBufferWriter $out, Vector2 $vector2)
 
static putVector3 (ByteBufferWriter $out, Vector3 $vector)
 
static putVector3Nullable (ByteBufferWriter $out, ?Vector3 $vector)
 
static readCreativeItemNetId (ByteBufferReader $in)
 
static readItemStackNetIdVariant (ByteBufferReader $in)
 
static readItemStackRequestId (ByteBufferReader $in)
 
static readLegacyItemStackRequestId (ByteBufferReader $in)
 
static readOptional (ByteBufferReader $in, \Closure $reader)
 
static readRecipeNetId (ByteBufferReader $in)
 
static readServerItemStackId (ByteBufferReader $in)
 
static writeCreativeItemNetId (ByteBufferWriter $out, int $id)
 
static writeItemStackNetIdVariant (ByteBufferWriter $out, int $id)
 
static writeItemStackRequestId (ByteBufferWriter $out, int $id)
 
static writeLegacyItemStackRequestId (ByteBufferWriter $out, int $id)
 
static writeOptional (ByteBufferWriter $out, mixed $value, \Closure $writer)
 
static writeRecipeNetId (ByteBufferWriter $out, int $id)
 
static writeServerItemStackId (ByteBufferWriter $out, int $id)
 

Detailed Description

Definition at line 70 of file CommonTypes.php.

Member Function Documentation

◆ getActorRuntimeId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getActorRuntimeId ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 426 of file CommonTypes.php.

◆ getActorUniqueId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getActorUniqueId ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 417 of file CommonTypes.php.

◆ getBlockPosition()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getBlockPosition ( ByteBufferReader $in)
static

Reads a block position with unsigned Y coordinate.

Exceptions
DataDecodeException

Definition at line 439 of file CommonTypes.php.

◆ getBool()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getBool ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 87 of file CommonTypes.php.

◆ getCommandOriginData()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getCommandOriginData ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 612 of file CommonTypes.php.

◆ getEntityLink()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getEntityLink ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 592 of file CommonTypes.php.

◆ getEntityMetadata()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getEntityMetadata ( ByteBufferReader $in)
static

Decodes entity metadata from the stream.

Returns
MetadataProperty[] @phpstan-return array<int, MetadataProperty>
Exceptions
PacketDecodeException
DataDecodeException

Definition at line 371 of file CommonTypes.php.

◆ getGameRules()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getGameRules ( ByteBufferReader $in,
bool $isStartGame )
static

Reads gamerules

Returns
GameRule[] game rule name => value @phpstan-return array<string, GameRule>
Exceptions
PacketDecodeException
DataDecodeException

Definition at line 562 of file CommonTypes.php.

◆ getItemStackWithoutStackId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getItemStackWithoutStackId ( ByteBufferReader $in)
static
Exceptions
PacketDecodeException
DataDecodeException

Definition at line 296 of file CommonTypes.php.

◆ getItemStackWrapper()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getItemStackWrapper ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 310 of file CommonTypes.php.

◆ getNbtCompoundRoot()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getNbtCompoundRoot ( ByteBufferReader $in)
static

Definition at line 724 of file CommonTypes.php.

◆ getNbtRoot()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getNbtRoot ( ByteBufferReader $in)
static
Exceptions
PacketDecodeException

Definition at line 713 of file CommonTypes.php.

◆ getRecipeIngredient()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getRecipeIngredient ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 338 of file CommonTypes.php.

◆ getRotationByte()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getRotationByte ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 535 of file CommonTypes.php.

◆ getSignedBlockPosition()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getSignedBlockPosition ( ByteBufferReader $in)
static

Reads a block position with a signed Y coordinate.

Exceptions
DataDecodeException

Definition at line 460 of file CommonTypes.php.

◆ getSkin()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getSkin ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 110 of file CommonTypes.php.

◆ getString()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getString ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 77 of file CommonTypes.php.

◆ getStructureEditorData()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getStructureEditorData ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 682 of file CommonTypes.php.

◆ getStructureSettings()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getStructureSettings ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 637 of file CommonTypes.php.

◆ getUUID()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getUUID ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 96 of file CommonTypes.php.

◆ getVector2()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getVector2 ( ByteBufferReader $in)
static

Reads a floating-point Vector2 object with coordinates rounded to 4 decimal places.

Exceptions
DataDecodeException

Definition at line 493 of file CommonTypes.php.

◆ getVector3()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::getVector3 ( ByteBufferReader $in)
static

Reads a floating-point Vector3 object with coordinates rounded to 4 decimal places.

Exceptions
DataDecodeException

Definition at line 481 of file CommonTypes.php.

◆ putActorRuntimeId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putActorRuntimeId ( ByteBufferWriter $out,
int $eid )
static

Definition at line 430 of file CommonTypes.php.

◆ putActorUniqueId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putActorUniqueId ( ByteBufferWriter $out,
int $eid )
static

Definition at line 421 of file CommonTypes.php.

◆ putBlockPosition()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putBlockPosition ( ByteBufferWriter $out,
BlockPosition $blockPosition )
static

Writes a block position with unsigned Y coordinate.

Definition at line 449 of file CommonTypes.php.

◆ putBool()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putBool ( ByteBufferWriter $out,
bool $v )
static

Definition at line 91 of file CommonTypes.php.

◆ putCommandOriginData()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putCommandOriginData ( ByteBufferWriter $out,
CommandOriginData $data )
static

Definition at line 626 of file CommonTypes.php.

◆ putEntityLink()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putEntityLink ( ByteBufferWriter $out,
EntityLink $link )
static

Definition at line 602 of file CommonTypes.php.

◆ putEntityMetadata()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putEntityMetadata ( ByteBufferWriter $out,
array $metadata )
static

Writes entity metadata to the packet buffer.

Parameters
MetadataProperty[]$metadata

@phpstan-param array<int, MetadataProperty> $metadata

Definition at line 407 of file CommonTypes.php.

◆ putGameRules()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putGameRules ( ByteBufferWriter $out,
array $rules,
bool $isStartGame )
static

Writes a gamerule array

Parameters
GameRule[]$rules@phpstan-param array<string, GameRule> $rules

Definition at line 581 of file CommonTypes.php.

◆ putItemStackWithoutStackId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putItemStackWithoutStackId ( ByteBufferWriter $out,
ItemStack $itemStack )
static

Definition at line 303 of file CommonTypes.php.

◆ putItemStackWrapper()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putItemStackWrapper ( ByteBufferWriter $out,
ItemStackWrapper $itemStackWrapper )
static

Definition at line 324 of file CommonTypes.php.

◆ putRecipeIngredient()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putRecipeIngredient ( ByteBufferWriter $out,
RecipeIngredient $ingredient )
static

Definition at line 353 of file CommonTypes.php.

◆ putRotationByte()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putRotationByte ( ByteBufferWriter $out,
float $rotation )
static

Definition at line 539 of file CommonTypes.php.

◆ putSignedBlockPosition()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putSignedBlockPosition ( ByteBufferWriter $out,
BlockPosition $blockPosition )
static

Writes a block position with a signed Y coordinate.

Definition at line 470 of file CommonTypes.php.

◆ putSkin()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putSkin ( ByteBufferWriter $out,
SkinData $skin )
static

Definition at line 188 of file CommonTypes.php.

◆ putString()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putString ( ByteBufferWriter $out,
string $v )
static

Definition at line 81 of file CommonTypes.php.

◆ putStructureEditorData()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putStructureEditorData ( ByteBufferWriter $out,
StructureEditorData $structureEditorData )
static

Definition at line 699 of file CommonTypes.php.

◆ putStructureSettings()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putStructureSettings ( ByteBufferWriter $out,
StructureSettings $structureSettings )
static

Definition at line 661 of file CommonTypes.php.

◆ putUUID()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putUUID ( ByteBufferWriter $out,
UuidInterface $uuid )
static

Definition at line 103 of file CommonTypes.php.

◆ putVector2()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putVector2 ( ByteBufferWriter $out,
Vector2 $vector2 )
static

Writes a floating-point Vector2 object

Definition at line 529 of file CommonTypes.php.

◆ putVector3()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putVector3 ( ByteBufferWriter $out,
Vector3 $vector )
static

Writes a floating-point Vector3 object

Definition at line 520 of file CommonTypes.php.

◆ putVector3Nullable()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::putVector3Nullable ( ByteBufferWriter $out,
?Vector3 $vector )
static

Writes a floating-point Vector3 object, or 3x zero if null is given.

Note: ONLY use this where it is reasonable to allow not specifying the vector. For all other purposes, use the non-nullable version.

See also
CommonTypes::putVector3()

Definition at line 507 of file CommonTypes.php.

◆ readCreativeItemNetId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::readCreativeItemNetId ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 742 of file CommonTypes.php.

◆ readItemStackNetIdVariant()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::readItemStackNetIdVariant ( ByteBufferReader $in)
static

This is a union of ItemStackRequestId, LegacyItemStackRequestId, and ServerItemStackId, used in serverbound packets to allow the client to refer to server known items, or items which may have been modified by a previous as-yet unacknowledged request from the client.

  • Server itemstack ID is positive
  • InventoryTransaction "legacy" request ID is negative and even
  • ItemStackRequest request ID is negative and odd
  • 0 refers to an empty itemstack (air)
Exceptions
DataDecodeException

Definition at line 762 of file CommonTypes.php.

◆ readItemStackRequestId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::readItemStackRequestId ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 776 of file CommonTypes.php.

◆ readLegacyItemStackRequestId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::readLegacyItemStackRequestId ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 785 of file CommonTypes.php.

◆ readOptional()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::readOptional ( ByteBufferReader $in,
\Closure $reader )
static

@phpstan-template T @phpstan-param \Closure(ByteBufferReader) : T $reader @phpstan-return T|null

Exceptions
DataDecodeException

Definition at line 808 of file CommonTypes.php.

◆ readRecipeNetId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::readRecipeNetId ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 733 of file CommonTypes.php.

◆ readServerItemStackId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::readServerItemStackId ( ByteBufferReader $in)
static
Exceptions
DataDecodeException

Definition at line 794 of file CommonTypes.php.

◆ writeCreativeItemNetId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::writeCreativeItemNetId ( ByteBufferWriter $out,
int $id )
static

Definition at line 746 of file CommonTypes.php.

◆ writeItemStackNetIdVariant()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::writeItemStackNetIdVariant ( ByteBufferWriter $out,
int $id )
static

This is a union of ItemStackRequestId, LegacyItemStackRequestId, and ServerItemStackId, used in serverbound packets to allow the client to refer to server known items, or items which may have been modified by a previous as-yet unacknowledged request from the client.

Definition at line 771 of file CommonTypes.php.

◆ writeItemStackRequestId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::writeItemStackRequestId ( ByteBufferWriter $out,
int $id )
static

Definition at line 780 of file CommonTypes.php.

◆ writeLegacyItemStackRequestId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::writeLegacyItemStackRequestId ( ByteBufferWriter $out,
int $id )
static

Definition at line 789 of file CommonTypes.php.

◆ writeOptional()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::writeOptional ( ByteBufferWriter $out,
mixed $value,
\Closure $writer )
static

@phpstan-template T @phpstan-param T|null $value @phpstan-param \Closure(ByteBufferWriter, T) : void $writer

Definition at line 820 of file CommonTypes.php.

◆ writeRecipeNetId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::writeRecipeNetId ( ByteBufferWriter $out,
int $id )
static

Definition at line 737 of file CommonTypes.php.

◆ writeServerItemStackId()

static pocketmine\network\mcpe\protocol\serializer\CommonTypes::writeServerItemStackId ( ByteBufferWriter $out,
int $id )
static

Definition at line 798 of file CommonTypes.php.


The documentation for this class was generated from the following file: