TextPacket
extends DataPacket
in package
implements
ClientboundPacket, ServerboundPacket
Interfaces, Classes, Traits and Enums
Table of Contents
- NETWORK_ID = \pocketmine\network\mcpe\protocol\ProtocolInfo::TEXT_PACKET
- PID_MASK = 0x3ff
- TYPE_ANNOUNCEMENT = 8
- TYPE_CHAT = 1
- TYPE_JSON = 10
- TYPE_JSON_WHISPER = 9
- TYPE_JUKEBOX_POPUP = 4
- TYPE_POPUP = 3
- TYPE_RAW = 0
- TYPE_SYSTEM = 6
- TYPE_TIP = 5
- TYPE_TRANSLATION = 2
- TYPE_WHISPER = 7
- RECIPIENT_SUBCLIENT_ID_SHIFT = 12
- SENDER_SUBCLIENT_ID_SHIFT = 10
- SUBCLIENT_ID_MASK = 0x3
- $message : string
- $needsTranslation : bool
- $parameters : array<string|int, mixed>
- $platformChatId : string
- $recipientSubId : int
- $senderSubId : int
- $sourceName : string
- $type : int
- $xboxUserId : string
- __get() : mixed
- __set() : void
- canBeSentBeforeLogin() : bool
- decode() : void
- encode() : void
- getName() : string
- handle() : bool
- jukeboxPopup() : TextPacket
- pid() : int
- popup() : self
- raw() : self
- tip() : self
- translatedPopup() : TextPacket
- translation() : TextPacket
- 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.
- baseTranslation() : self
- messageOnly() : self
Constants
NETWORK_ID
public
mixed
NETWORK_ID
= \pocketmine\network\mcpe\protocol\ProtocolInfo::TEXT_PACKET
PID_MASK
public
mixed
PID_MASK
= 0x3ff
TYPE_ANNOUNCEMENT
public
mixed
TYPE_ANNOUNCEMENT
= 8
TYPE_CHAT
public
mixed
TYPE_CHAT
= 1
TYPE_JSON
public
mixed
TYPE_JSON
= 10
TYPE_JSON_WHISPER
public
mixed
TYPE_JSON_WHISPER
= 9
TYPE_JUKEBOX_POPUP
public
mixed
TYPE_JUKEBOX_POPUP
= 4
TYPE_POPUP
public
mixed
TYPE_POPUP
= 3
TYPE_RAW
public
mixed
TYPE_RAW
= 0
TYPE_SYSTEM
public
mixed
TYPE_SYSTEM
= 6
TYPE_TIP
public
mixed
TYPE_TIP
= 5
TYPE_TRANSLATION
public
mixed
TYPE_TRANSLATION
= 2
TYPE_WHISPER
public
mixed
TYPE_WHISPER
= 7
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
$message
public
string
$message
$needsTranslation
public
bool
$needsTranslation
= false
$parameters
public
array<string|int, mixed>
$parameters
= []
$platformChatId
public
string
$platformChatId
= ""
$recipientSubId
public
int
$recipientSubId
= 0
$senderSubId
public
int
$senderSubId
= 0
$sourceName
public
string
$sourceName
$type
public
int
$type
$xboxUserId
public
string
$xboxUserId
= ""
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 —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 —jukeboxPopup()
public
static jukeboxPopup(string $key[, array<string|int, string> $parameters = [] ]) : TextPacket
Parameters
- $key : string
- $parameters : array<string|int, string> = []
Return values
TextPacket —pid()
public
pid() : int
Return values
int —popup()
public
static popup(string $message) : self
Parameters
- $message : string
Return values
self —raw()
public
static raw(string $message) : self
Parameters
- $message : string
Return values
self —tip()
public
static tip(string $message) : self
Parameters
- $message : string
Return values
self —translatedPopup()
public
static translatedPopup(string $key[, array<string|int, string> $parameters = [] ]) : TextPacket
Parameters
- $key : string
- $parameters : array<string|int, string> = []
Return values
TextPacket —translation()
public
static translation(string $key[, array<string|int, string> $parameters = [] ]) : TextPacket
Parameters
- $key : string
- $parameters : array<string|int, string> = []
Return values
TextPacket —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 —baseTranslation()
private
static baseTranslation(int $type, string $key, array<string|int, string> $parameters) : self
Parameters
- $type : int
- $key : string
- $parameters : array<string|int, string>
Return values
self —messageOnly()
private
static messageOnly(int $type, string $message) : self
Parameters
- $type : int
- $message : string