PocketMine-MP
5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
Loading...
Searching...
No Matches
UpdateBlockSyncedPacket.php
1
<?php
2
3
/*
4
* This file is part of BedrockProtocol.
5
* Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/BedrockProtocol>
6
*
7
* BedrockProtocol is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU Lesser General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*/
12
13
declare(strict_types=1);
14
15
namespace
pocketmine\network\mcpe\protocol;
16
17
use
pocketmine\network\mcpe\protocol\serializer\PacketSerializer
;
18
19
class
UpdateBlockSyncedPacket
extends
UpdateBlockPacket
{
20
public
const
NETWORK_ID = ProtocolInfo::UPDATE_BLOCK_SYNCED_PACKET;
21
22
public
const
TYPE_NONE = 0;
23
public
const
TYPE_CREATE = 1;
24
public
const
TYPE_DESTROY = 2;
25
26
public
int
$actorUniqueId;
27
public
int
$updateType;
28
29
protected
function
decodePayload
(
PacketSerializer
$in) : void{
30
parent::
decodePayload
($in);
31
$this->actorUniqueId = $in->
getUnsignedVarLong
();
32
$this->updateType = $in->
getUnsignedVarLong
();
33
}
34
35
protected
function
encodePayload
(
PacketSerializer
$out) : void{
36
parent::encodePayload($out);
37
$out->
putUnsignedVarLong
($this->actorUniqueId);
38
$out->
putUnsignedVarLong
($this->updateType);
39
}
40
41
public
function
handle
(
PacketHandlerInterface
$handler) : bool{
42
return $handler->handleUpdateBlockSynced($this);
43
}
44
}
pocketmine\network\mcpe\protocol\UpdateBlockPacket
Definition
UpdateBlockPacket.php:20
pocketmine\network\mcpe\protocol\UpdateBlockSyncedPacket
Definition
UpdateBlockSyncedPacket.php:19
pocketmine\network\mcpe\protocol\UpdateBlockSyncedPacket\encodePayload
encodePayload(PacketSerializer $out)
Definition
UpdateBlockSyncedPacket.php:35
pocketmine\network\mcpe\protocol\UpdateBlockSyncedPacket\decodePayload
decodePayload(PacketSerializer $in)
Definition
UpdateBlockSyncedPacket.php:29
pocketmine\network\mcpe\protocol\UpdateBlockSyncedPacket\handle
handle(PacketHandlerInterface $handler)
Definition
UpdateBlockSyncedPacket.php:41
pocketmine\network\mcpe\protocol\serializer\PacketSerializer
Definition
bedrock-protocol/src/serializer/PacketSerializer.php:66
pocketmine\utils\BinaryStream\putUnsignedVarLong
putUnsignedVarLong(int $v)
Definition
BinaryStream.php:348
pocketmine\utils\BinaryStream\getUnsignedVarLong
getUnsignedVarLong()
Definition
BinaryStream.php:341
pocketmine\network\mcpe\protocol\PacketHandlerInterface
Definition
PacketHandlerInterface.php:20
vendor
pocketmine
bedrock-protocol
src
UpdateBlockSyncedPacket.php
Generated by
1.12.0