mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-04 09:10:00 +00:00
LabTablePacket: updated type field and added constants
This commit is contained in:
parent
534af770f8
commit
0d5164af02
@ -30,8 +30,12 @@ use pocketmine\network\mcpe\NetworkSession;
|
|||||||
class LabTablePacket extends DataPacket{
|
class LabTablePacket extends DataPacket{
|
||||||
public const NETWORK_ID = ProtocolInfo::LAB_TABLE_PACKET;
|
public const NETWORK_ID = ProtocolInfo::LAB_TABLE_PACKET;
|
||||||
|
|
||||||
|
public const TYPE_START_COMBINE = 0;
|
||||||
|
public const TYPE_START_REACTION = 1;
|
||||||
|
public const TYPE_RESET = 2;
|
||||||
|
|
||||||
/** @var int */
|
/** @var int */
|
||||||
public $uselessByte; //0 for client -> server, 1 for server -> client. Seems useless.
|
public $type;
|
||||||
|
|
||||||
/** @var int */
|
/** @var int */
|
||||||
public $x;
|
public $x;
|
||||||
@ -44,13 +48,13 @@ class LabTablePacket extends DataPacket{
|
|||||||
public $reactionType;
|
public $reactionType;
|
||||||
|
|
||||||
protected function decodePayload(){
|
protected function decodePayload(){
|
||||||
$this->uselessByte = $this->getByte();
|
$this->type = $this->getByte();
|
||||||
$this->getSignedBlockPosition($this->x, $this->y, $this->z);
|
$this->getSignedBlockPosition($this->x, $this->y, $this->z);
|
||||||
$this->reactionType = $this->getByte();
|
$this->reactionType = $this->getByte();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function encodePayload(){
|
protected function encodePayload(){
|
||||||
$this->putByte($this->uselessByte);
|
$this->putByte($this->type);
|
||||||
$this->putSignedBlockPosition($this->x, $this->y, $this->z);
|
$this->putSignedBlockPosition($this->x, $this->y, $this->z);
|
||||||
$this->putByte($this->reactionType);
|
$this->putByte($this->reactionType);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user