Corrected encode/decode of TextPacket parameters

This commit is contained in:
Dylan K. Taylor 2016-11-03 15:55:08 +00:00
parent cf222324d6
commit e60364d7c9

View File

@ -54,7 +54,7 @@ class TextPacket extends DataPacket{
case self::TYPE_TRANSLATION:
$this->message = $this->getString();
$count = $this->getByte();
$count = $this->getUnsignedVarInt();
for($i = 0; $i < $count; ++$i){
$this->parameters[] = $this->getString();
}
@ -76,7 +76,7 @@ class TextPacket extends DataPacket{
case self::TYPE_TRANSLATION:
$this->putString($this->message);
$this->putByte(count($this->parameters));
$this->putUnsignedVarInt(count($this->parameters));
foreach($this->parameters as $p){
$this->putString($p);
}