mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
duct tape for block ID remapping
This commit is contained in:
@ -47,24 +47,20 @@ class UpdateBlockPacket extends DataPacket{
|
||||
/** @var int */
|
||||
public $y;
|
||||
/** @var int */
|
||||
public $blockId;
|
||||
/** @var int */
|
||||
public $blockData;
|
||||
public $blockRuntimeId;
|
||||
/** @var int */
|
||||
public $flags;
|
||||
|
||||
protected function decodePayload(){
|
||||
$this->getBlockPosition($this->x, $this->y, $this->z);
|
||||
$this->blockId = $this->getUnsignedVarInt();
|
||||
$aux = $this->getUnsignedVarInt();
|
||||
$this->blockData = $aux & 0x0f;
|
||||
$this->flags = $aux >> 4;
|
||||
$this->blockRuntimeId = $this->getUnsignedVarInt();
|
||||
$this->flags = $this->getUnsignedVarInt();
|
||||
}
|
||||
|
||||
protected function encodePayload(){
|
||||
$this->putBlockPosition($this->x, $this->y, $this->z);
|
||||
$this->putUnsignedVarInt($this->blockId);
|
||||
$this->putUnsignedVarInt(($this->flags << 4) | $this->blockData);
|
||||
$this->putUnsignedVarInt($this->blockRuntimeId);
|
||||
$this->putUnsignedVarInt($this->flags);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
|
Reference in New Issue
Block a user