diff --git a/src/pocketmine/network/mcpe/protocol/DataPacket.php b/src/pocketmine/network/mcpe/protocol/DataPacket.php index c6dec0c87..562ba446f 100644 --- a/src/pocketmine/network/mcpe/protocol/DataPacket.php +++ b/src/pocketmine/network/mcpe/protocol/DataPacket.php @@ -84,6 +84,7 @@ abstract class DataPacket extends BinaryStream{ public function encode(){ $this->reset(); + $this->encodeHeader(); $this->encodePayload(); $this->isEncoded = true; } @@ -114,11 +115,6 @@ abstract class DataPacket extends BinaryStream{ */ abstract public function handle(NetworkSession $session) : bool; - public function reset(){ - $this->encodeHeader(); - $this->offset = 0; - } - public function clean(){ $this->buffer = null; $this->isEncoded = false;