AvailableCommandsPacket
extends DataPacket
in package
implements
ClientboundPacket
Interfaces, Classes, Traits and Enums
Table of Contents
- ARG_FLAG_ENUM = 0x200000
- Enums are a little different: they are composed as follows: ARG_FLAG_ENUM | ARG_FLAG_VALID | (enum index)
- ARG_FLAG_POSTFIX = 0x1000000
- This is used for /xp <level: int>L. It can only be applied to integer parameters.
- ARG_FLAG_VALID = 0x100000
- This flag is set on all types EXCEPT the POSTFIX type. Not completely sure what this is for, but it is required for the argtype to work correctly. VALID seems as good a name as any.
- ARG_TYPE_COMMAND = 0x3f
- ARG_TYPE_FILEPATH = 0x10
- ARG_TYPE_FLOAT = 0x3
- ARG_TYPE_INT = 0x1
- Basic parameter types. These must be combined with the ARG_FLAG_VALID constant.
- ARG_TYPE_JSON = 0x32
- ARG_TYPE_MESSAGE = 0x2c
- ARG_TYPE_OPERATOR = 0x6
- ARG_TYPE_POSITION = 0x28
- ARG_TYPE_RAWTEXT = 0x2e
- ARG_TYPE_STRING = 0x20
- ARG_TYPE_TARGET = 0x7
- ARG_TYPE_VALUE = 0x4
- ARG_TYPE_WILDCARD_INT = 0x5
- ARG_TYPE_WILDCARD_TARGET = 0x8
- HARDCODED_ENUM_NAMES = ["CommandName" => true]
- NETWORK_ID = \pocketmine\network\mcpe\protocol\ProtocolInfo::AVAILABLE_COMMANDS_PACKET
- PID_MASK = 0x3ff
- RECIPIENT_SUBCLIENT_ID_SHIFT = 12
- SENDER_SUBCLIENT_ID_SHIFT = 10
- SUBCLIENT_ID_MASK = 0x3
- $commandData : array<string|int, mixed>
- $enumConstraints : array<string|int, mixed>
- $hardcodedEnums : array<string|int, mixed>
- $recipientSubId : int
- $senderSubId : int
- $softEnums : array<string|int, mixed>
- __get() : mixed
- __set() : void
- canBeSentBeforeLogin() : bool
- create() : self
- decode() : void
- encode() : void
- getName() : string
- handle() : bool
- pid() : int
- decodeHeader() : void
- decodePayload() : void
- Decodes the packet body, without the packet ID or other generic header fields.
- encodeHeader() : void
- encodePayload() : void
- Encodes the packet body, without the packet ID or other generic header fields.
- getCommandData() : CommandData
- getEnum() : CommandEnum
- getEnumConstraint() : CommandEnumConstraint
- getEnumValueIndex() : int
- getSoftEnum() : CommandEnum
- putCommandData() : void
- putEnum() : void
- putEnumConstraint() : void
- putEnumValueIndex() : void
- putSoftEnum() : void
Constants
ARG_FLAG_ENUM
Enums are a little different: they are composed as follows: ARG_FLAG_ENUM | ARG_FLAG_VALID | (enum index)
public
mixed
ARG_FLAG_ENUM
= 0x200000
ARG_FLAG_POSTFIX
This is used for /xp <level: int>L. It can only be applied to integer parameters.
public
mixed
ARG_FLAG_POSTFIX
= 0x1000000
ARG_FLAG_VALID
This flag is set on all types EXCEPT the POSTFIX type. Not completely sure what this is for, but it is required for the argtype to work correctly. VALID seems as good a name as any.
public
mixed
ARG_FLAG_VALID
= 0x100000
ARG_TYPE_COMMAND
public
mixed
ARG_TYPE_COMMAND
= 0x3f
ARG_TYPE_FILEPATH
public
mixed
ARG_TYPE_FILEPATH
= 0x10
ARG_TYPE_FLOAT
public
mixed
ARG_TYPE_FLOAT
= 0x3
ARG_TYPE_INT
Basic parameter types. These must be combined with the ARG_FLAG_VALID constant.
public
mixed
ARG_TYPE_INT
= 0x1
ARG_FLAG_VALID | (type const)
ARG_TYPE_JSON
public
mixed
ARG_TYPE_JSON
= 0x32
ARG_TYPE_MESSAGE
public
mixed
ARG_TYPE_MESSAGE
= 0x2c
ARG_TYPE_OPERATOR
public
mixed
ARG_TYPE_OPERATOR
= 0x6
ARG_TYPE_POSITION
public
mixed
ARG_TYPE_POSITION
= 0x28
ARG_TYPE_RAWTEXT
public
mixed
ARG_TYPE_RAWTEXT
= 0x2e
ARG_TYPE_STRING
public
mixed
ARG_TYPE_STRING
= 0x20
ARG_TYPE_TARGET
public
mixed
ARG_TYPE_TARGET
= 0x7
ARG_TYPE_VALUE
public
mixed
ARG_TYPE_VALUE
= 0x4
ARG_TYPE_WILDCARD_INT
public
mixed
ARG_TYPE_WILDCARD_INT
= 0x5
ARG_TYPE_WILDCARD_TARGET
public
mixed
ARG_TYPE_WILDCARD_TARGET
= 0x8
HARDCODED_ENUM_NAMES
public
mixed
HARDCODED_ENUM_NAMES
= ["CommandName" => true]
NETWORK_ID
public
mixed
NETWORK_ID
= \pocketmine\network\mcpe\protocol\ProtocolInfo::AVAILABLE_COMMANDS_PACKET
PID_MASK
public
mixed
PID_MASK
= 0x3ff
RECIPIENT_SUBCLIENT_ID_SHIFT
private
mixed
RECIPIENT_SUBCLIENT_ID_SHIFT
= 12
SENDER_SUBCLIENT_ID_SHIFT
private
mixed
SENDER_SUBCLIENT_ID_SHIFT
= 10
SUBCLIENT_ID_MASK
private
mixed
SUBCLIENT_ID_MASK
= 0x3
Properties
$commandData
public
array<string|int, mixed>
$commandData
= []
List of command data, including name, description, alias indexes and parameters.
$enumConstraints
public
array<string|int, mixed>
$enumConstraints
= []
List of constraints for enum members. Used to constrain gamerules that can bechanged in nocheats mode and more.
$hardcodedEnums
public
array<string|int, mixed>
$hardcodedEnums
= []
List of enums which aren't directly referenced by any vanilla command.
This is used for the CommandName
enum, which is a magic enum used by the command
argument type.
$recipientSubId
public
int
$recipientSubId
= 0
$senderSubId
public
int
$senderSubId
= 0
$softEnums
public
array<string|int, mixed>
$softEnums
= []
List of dynamic command enums, also referred to as "soft" enums. These can by dynamically updated mid-game without resending this packet.
Methods
__get()
public
__get(string $name) : mixed
Parameters
- $name : string
Return values
mixed —__set()
public
__set(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
Return values
void —canBeSentBeforeLogin()
public
canBeSentBeforeLogin() : bool
Return values
bool —create()
public
static create(array<string|int, CommandData> $commandData, array<string|int, CommandEnum> $hardcodedEnums, array<string|int, CommandEnum> $softEnums, array<string|int, CommandEnumConstraint> $enumConstraints) : self
Parameters
- $commandData : array<string|int, CommandData>
- $hardcodedEnums : array<string|int, CommandEnum>
- $softEnums : array<string|int, CommandEnum>
- $enumConstraints : array<string|int, CommandEnumConstraint>
Tags
Return values
self —decode()
public
final decode(PacketSerializer $in) : void
Parameters
- $in : PacketSerializer
Tags
Return values
void —encode()
public
final encode(PacketSerializer $out) : void
Parameters
- $out : PacketSerializer
Return values
void —getName()
public
getName() : string
Return values
string —handle()
public
handle(PacketHandlerInterface $handler) : bool
Parameters
- $handler : PacketHandlerInterface
Return values
bool —pid()
public
pid() : int
Return values
int —decodeHeader()
protected
decodeHeader(PacketSerializer $in) : void
Parameters
- $in : PacketSerializer
Tags
Return values
void —decodePayload()
Decodes the packet body, without the packet ID or other generic header fields.
protected
decodePayload(PacketSerializer $in) : void
Parameters
- $in : PacketSerializer
Return values
void —encodeHeader()
protected
encodeHeader(PacketSerializer $out) : void
Parameters
- $out : PacketSerializer
Return values
void —encodePayload()
Encodes the packet body, without the packet ID or other generic header fields.
protected
encodePayload(PacketSerializer $out) : void
Parameters
- $out : PacketSerializer
Return values
void —getCommandData()
protected
getCommandData(array<string|int, CommandEnum> $enums, array<string|int, string> $postfixes, PacketSerializer $in) : CommandData
Parameters
- $enums : array<string|int, CommandEnum>
- $postfixes : array<string|int, string>
- $in : PacketSerializer
Tags
Return values
CommandData —getEnum()
protected
getEnum(array<string|int, string> $enumValueList, PacketSerializer $in) : CommandEnum
Parameters
- $enumValueList : array<string|int, string>
- $in : PacketSerializer
Tags
Return values
CommandEnum —getEnumConstraint()
protected
getEnumConstraint(array<string|int, CommandEnum> $enums, array<string|int, string> $enumValues, PacketSerializer $in) : CommandEnumConstraint
Parameters
- $enums : array<string|int, CommandEnum>
- $enumValues : array<string|int, string>
- $in : PacketSerializer
Tags
Return values
CommandEnumConstraint —getEnumValueIndex()
protected
getEnumValueIndex(int $valueCount, PacketSerializer $in) : int
Parameters
- $valueCount : int
- $in : PacketSerializer
Tags
Return values
int —getSoftEnum()
protected
getSoftEnum(PacketSerializer $in) : CommandEnum
Parameters
- $in : PacketSerializer
Tags
Return values
CommandEnum —putCommandData()
protected
putCommandData(CommandData $data, array<string|int, int> $enumIndexes, array<string|int, int> $postfixIndexes, PacketSerializer $out) : void
Parameters
- $data : CommandData
- $enumIndexes : array<string|int, int>
-
string enum name -> int index
- $postfixIndexes : array<string|int, int>
- $out : PacketSerializer
Return values
void —putEnum()
protected
putEnum(CommandEnum $enum, array<string|int, int> $enumValueMap, PacketSerializer $out) : void
Parameters
- $enum : CommandEnum
- $enumValueMap : array<string|int, int>
- $out : PacketSerializer
Return values
void —putEnumConstraint()
protected
putEnumConstraint(CommandEnumConstraint $constraint, array<string|int, int> $enumIndexes, array<string|int, int> $enumValueIndexes, PacketSerializer $out) : void
Parameters
- $constraint : CommandEnumConstraint
- $enumIndexes : array<string|int, int>
-
string enum name -> int index
- $enumValueIndexes : array<string|int, int>
-
string value -> int index
- $out : PacketSerializer
Return values
void —putEnumValueIndex()
protected
putEnumValueIndex(int $index, int $valueCount, PacketSerializer $out) : void
Parameters
- $index : int
- $valueCount : int
- $out : PacketSerializer
Return values
void —putSoftEnum()
protected
putSoftEnum(CommandEnum $enum, PacketSerializer $out) : void
Parameters
- $enum : CommandEnum
- $out : PacketSerializer