Made Binary::readVarInt/VarLong methods less useless

This commit is contained in:
Dylan K. Taylor
2017-05-30 14:19:34 +01:00
parent caced595d2
commit db3cd1829c
3 changed files with 46 additions and 32 deletions

View File

@ -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);
}