mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 05:55:33 +00:00
Corrected encode/decode of TextPacket parameters
This commit is contained in:
parent
cf222324d6
commit
e60364d7c9
@ -54,7 +54,7 @@ class TextPacket extends DataPacket{
|
|||||||
|
|
||||||
case self::TYPE_TRANSLATION:
|
case self::TYPE_TRANSLATION:
|
||||||
$this->message = $this->getString();
|
$this->message = $this->getString();
|
||||||
$count = $this->getByte();
|
$count = $this->getUnsignedVarInt();
|
||||||
for($i = 0; $i < $count; ++$i){
|
for($i = 0; $i < $count; ++$i){
|
||||||
$this->parameters[] = $this->getString();
|
$this->parameters[] = $this->getString();
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ class TextPacket extends DataPacket{
|
|||||||
|
|
||||||
case self::TYPE_TRANSLATION:
|
case self::TYPE_TRANSLATION:
|
||||||
$this->putString($this->message);
|
$this->putString($this->message);
|
||||||
$this->putByte(count($this->parameters));
|
$this->putUnsignedVarInt(count($this->parameters));
|
||||||
foreach($this->parameters as $p){
|
foreach($this->parameters as $p){
|
||||||
$this->putString($p);
|
$this->putString($p);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user