mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Fixed wrong encoding of NBT strings, fixed invisible signs issues
This commit is contained in:
parent
8bf8e2e22f
commit
06f0534d65
@ -593,13 +593,13 @@ class NBT{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getString(bool $network = false){
|
public function getString(bool $network = false){
|
||||||
$len = $network ? $this->getByte() : $this->getShort();
|
$len = $network ? Binary::readUnsignedVarInt($this) : $this->getShort();
|
||||||
return $this->get($len);
|
return $this->get($len);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function putString($v, bool $network = false){
|
public function putString($v, bool $network = false){
|
||||||
if($network === true){
|
if($network === true){
|
||||||
$this->putByte(strlen($v));
|
$this->put(Binary::writeUnsignedVarInt(strlen($v)));
|
||||||
}else{
|
}else{
|
||||||
$this->putShort(strlen($v));
|
$this->putShort(strlen($v));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user