mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Renamed BlockEventPacket fields
This commit is contained in:
parent
f4ff5d81ea
commit
f14b7cbf78
@ -85,8 +85,8 @@ class ChestInventory extends ContainerInventory{
|
||||
$pk->x = (int) $vector->x;
|
||||
$pk->y = (int) $vector->y;
|
||||
$pk->z = (int) $vector->z;
|
||||
$pk->case1 = 1; //it's always 1 for a chest
|
||||
$pk->case2 = $isOpen ? 1 : 0;
|
||||
$pk->eventType = 1; //it's always 1 for a chest
|
||||
$pk->eventData = $isOpen ? 1 : 0;
|
||||
$this->getHolder()->getLevel()->addChunkPacket($this->getHolder()->getX() >> 4, $this->getHolder()->getZ() >> 4, $pk);
|
||||
}
|
||||
}
|
||||
|
@ -38,20 +38,20 @@ class BlockEventPacket extends DataPacket{
|
||||
/** @var int */
|
||||
public $z;
|
||||
/** @var int */
|
||||
public $case1;
|
||||
public $eventType;
|
||||
/** @var int */
|
||||
public $case2;
|
||||
public $eventData;
|
||||
|
||||
protected function decodePayload(){
|
||||
$this->getBlockPosition($this->x, $this->y, $this->z);
|
||||
$this->case1 = $this->getVarInt();
|
||||
$this->case2 = $this->getVarInt();
|
||||
$this->eventType = $this->getVarInt();
|
||||
$this->eventData = $this->getVarInt();
|
||||
}
|
||||
|
||||
protected function encodePayload(){
|
||||
$this->putBlockPosition($this->x, $this->y, $this->z);
|
||||
$this->putVarInt($this->case1);
|
||||
$this->putVarInt($this->case2);
|
||||
$this->putVarInt($this->eventType);
|
||||
$this->putVarInt($this->eventData);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
|
Loading…
x
Reference in New Issue
Block a user