mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Fixed LongTags in tile NBT
This commit is contained in:
@ -308,12 +308,19 @@ class NBT{
|
||||
}
|
||||
}
|
||||
|
||||
public function getLong() : int{
|
||||
public function getLong(bool $network = false) : int{
|
||||
if($network){
|
||||
return Binary::readVarLong($this->buffer, $this->offset);
|
||||
}
|
||||
return $this->endianness === self::BIG_ENDIAN ? Binary::readLong($this->get(8)) : Binary::readLLong($this->get(8));
|
||||
}
|
||||
|
||||
public function putLong($v){
|
||||
$this->buffer .= $this->endianness === self::BIG_ENDIAN ? Binary::writeLong($v) : Binary::writeLLong($v);
|
||||
public function putLong($v, bool $network = false){
|
||||
if($network){
|
||||
$this->buffer .= Binary::writeVarLong($v);
|
||||
}else{
|
||||
$this->buffer .= $this->endianness === self::BIG_ENDIAN ? Binary::writeLong($v) : Binary::writeLLong($v);
|
||||
}
|
||||
}
|
||||
|
||||
public function getFloat() : float{
|
||||
|
Reference in New Issue
Block a user