mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 16:45:13 +00:00
UpdateBlockPacket fixed and changed skinName to skinId
This commit is contained in:
@ -36,7 +36,12 @@ class UpdateBlockPacket extends DataPacket{
|
||||
const FLAG_ALL = (self::FLAG_NEIGHBORS | self::FLAG_NETWORK);
|
||||
const FLAG_ALL_PRIORITY = (self::FLAG_ALL | self::FLAG_PRIORITY);
|
||||
|
||||
public $records = []; //x, z, y, blockId, blockData, flags
|
||||
public $x;
|
||||
public $z;
|
||||
public $y;
|
||||
public $blockId;
|
||||
public $blockData;
|
||||
public $flags;
|
||||
|
||||
public function decode(){
|
||||
|
||||
@ -44,14 +49,11 @@ class UpdateBlockPacket extends DataPacket{
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt(count($this->records));
|
||||
foreach($this->records as $r){
|
||||
$this->putInt($r[0]);
|
||||
$this->putInt($r[1]);
|
||||
$this->putByte($r[2]);
|
||||
$this->putByte($r[3]);
|
||||
$this->putByte(($r[5] << 4) | $r[4]);
|
||||
}
|
||||
$this->putInt($this->x);
|
||||
$this->putInt($this->z);
|
||||
$this->putByte($this->y);
|
||||
$this->putByte($this->blockId);
|
||||
$this->putByte(($this->flags << 4) | $this->blockData);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user