Skip to content
This repository was archived by the owner on Feb 2, 2018. It is now read-only.

Commit 8521832

Browse files
committed
UseItemPacket Encode
1 parent 114ba20 commit 8521832

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/pocketmine/network/protocol/UpdateBlockPacket.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ class UpdateBlockPacket extends DataPacket{
2323
public $blockData;
2424
public $flags;
2525

26-
public function decode(){
27-
26+
public function decode(){/*
27+
$this->getBlockCoords($this->x, $this->y, $this->z);
28+
$this->blockId = $this->getUnsignedVarInt();
29+
$temp = $this->getUnsignedVarInt();//TODO: right calc?
30+
$blockData = $temp
31+
(($this->flags >> 4) & ~$this->blockData);*/
2832
}
2933

3034
public function encode(){

src/pocketmine/network/protocol/UseItemPacket.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ public function decode(){
3030
}
3131

3232
public function encode(){
33-
33+
$this->reset();
34+
$this->putBlockCoords($this->x, $this->y, $this->z);
35+
$this->putVarInt($this->face);
36+
$this->putVector3f($this->fx, $this->fy, $this->fz);
37+
$this->putVector3f($this->posX, $this->posY, $this->posZ);
38+
$this->putVarInt($this->slot);
39+
$this->putSlot($this->item);
3440
}
3541

3642
}

0 commit comments

Comments
 (0)