mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
Fixed block picking, added PlayerBlockPickEvent
This commit is contained in:
@ -33,24 +33,24 @@ class BlockPickRequestPacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::BLOCK_PICK_REQUEST_PACKET;
|
||||
|
||||
/** @var int */
|
||||
public $tileX;
|
||||
public $blockX;
|
||||
/** @var int */
|
||||
public $tileY;
|
||||
public $blockY;
|
||||
/** @var int */
|
||||
public $tileZ;
|
||||
public $blockZ;
|
||||
/** @var bool */
|
||||
public $addUserData = false;
|
||||
/** @var int */
|
||||
public $hotbarSlot;
|
||||
|
||||
protected function decodePayload(){
|
||||
$this->getSignedBlockPosition($this->tileX, $this->tileY, $this->tileZ);
|
||||
$this->getSignedBlockPosition($this->blockX, $this->blockY, $this->blockZ);
|
||||
$this->addUserData = $this->getBool();
|
||||
$this->hotbarSlot = $this->getByte();
|
||||
}
|
||||
|
||||
protected function encodePayload(){
|
||||
$this->putSignedBlockPosition($this->tileX, $this->tileY, $this->tileZ);
|
||||
$this->putSignedBlockPosition($this->blockX, $this->blockY, $this->blockZ);
|
||||
$this->putBool($this->addUserData);
|
||||
$this->putByte($this->hotbarSlot);
|
||||
}
|
||||
|
Reference in New Issue
Block a user