mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
Merge branch 'php/7.0' into mcpe-1.2
This commit is contained in:
commit
ca84532640
@ -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{
|
||||
|
@ -43,13 +43,11 @@ class LongTag extends NamedTag{
|
||||
return NBT::TAG_Long;
|
||||
}
|
||||
|
||||
//TODO: check if this also changed to varint
|
||||
|
||||
public function read(NBT $nbt, bool $network = false){
|
||||
$this->value = $nbt->getLong();
|
||||
$this->value = $nbt->getLong($network);
|
||||
}
|
||||
|
||||
public function write(NBT $nbt, bool $network = false){
|
||||
$nbt->putLong($this->value);
|
||||
$nbt->putLong($this->value, $network);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user