mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Made Binary::readVarInt/VarLong methods less useless
This commit is contained in:
@ -285,7 +285,7 @@ class NBT{
|
||||
|
||||
public function getInt(bool $network = false){
|
||||
if($network === true){
|
||||
return Binary::readVarInt($this);
|
||||
return Binary::readVarInt($this->buffer, $this->offset);
|
||||
}
|
||||
return $this->endianness === self::BIG_ENDIAN ? Binary::readInt($this->get(4)) : Binary::readLInt($this->get(4));
|
||||
}
|
||||
@ -323,7 +323,7 @@ class NBT{
|
||||
}
|
||||
|
||||
public function getString(bool $network = false){
|
||||
$len = $network ? Binary::readUnsignedVarInt($this) : $this->getShort();
|
||||
$len = $network ? Binary::readUnsignedVarInt($this->buffer, $this->offset) : $this->getShort();
|
||||
return $this->get($len);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user