Renamed BlockEventPacket fields

This commit is contained in:
Dylan K. Taylor 2017-10-16 19:55:42 +01:00
parent f4ff5d81ea
commit f14b7cbf78
2 changed files with 8 additions and 8 deletions

View File

@ -85,8 +85,8 @@ class ChestInventory extends ContainerInventory{
$pk->x = (int) $vector->x; $pk->x = (int) $vector->x;
$pk->y = (int) $vector->y; $pk->y = (int) $vector->y;
$pk->z = (int) $vector->z; $pk->z = (int) $vector->z;
$pk->case1 = 1; //it's always 1 for a chest $pk->eventType = 1; //it's always 1 for a chest
$pk->case2 = $isOpen ? 1 : 0; $pk->eventData = $isOpen ? 1 : 0;
$this->getHolder()->getLevel()->addChunkPacket($this->getHolder()->getX() >> 4, $this->getHolder()->getZ() >> 4, $pk); $this->getHolder()->getLevel()->addChunkPacket($this->getHolder()->getX() >> 4, $this->getHolder()->getZ() >> 4, $pk);
} }
} }

View File

@ -38,20 +38,20 @@ class BlockEventPacket extends DataPacket{
/** @var int */ /** @var int */
public $z; public $z;
/** @var int */ /** @var int */
public $case1; public $eventType;
/** @var int */ /** @var int */
public $case2; public $eventData;
protected function decodePayload(){ protected function decodePayload(){
$this->getBlockPosition($this->x, $this->y, $this->z); $this->getBlockPosition($this->x, $this->y, $this->z);
$this->case1 = $this->getVarInt(); $this->eventType = $this->getVarInt();
$this->case2 = $this->getVarInt(); $this->eventData = $this->getVarInt();
} }
protected function encodePayload(){ protected function encodePayload(){
$this->putBlockPosition($this->x, $this->y, $this->z); $this->putBlockPosition($this->x, $this->y, $this->z);
$this->putVarInt($this->case1); $this->putVarInt($this->eventType);
$this->putVarInt($this->case2); $this->putVarInt($this->eventData);
} }
public function handle(NetworkSession $session) : bool{ public function handle(NetworkSession $session) : bool{