mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-19 01:44:06 +00:00
Fixed TAG_Short being read as unsigned
This commit is contained in:
parent
a1ce535d02
commit
22d148a59d
@ -285,6 +285,10 @@ class NBT{
|
|||||||
return $this->endianness === self::BIG_ENDIAN ? Binary::readShort($this->get(2)) : Binary::readLShort($this->get(2));
|
return $this->endianness === self::BIG_ENDIAN ? Binary::readShort($this->get(2)) : Binary::readLShort($this->get(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSignedShort() : int{
|
||||||
|
return $this->endianness === self::BIG_ENDIAN ? Binary::readSignedShort($this->get(2)) : Binary::readSignedLShort($this->get(2));
|
||||||
|
}
|
||||||
|
|
||||||
public function putShort($v){
|
public function putShort($v){
|
||||||
$this->buffer .= $this->endianness === self::BIG_ENDIAN ? Binary::writeShort($v) : Binary::writeLShort($v);
|
$this->buffer .= $this->endianness === self::BIG_ENDIAN ? Binary::writeShort($v) : Binary::writeLShort($v);
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ class ShortTag extends NamedTag{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function read(NBT $nbt, bool $network = false){
|
public function read(NBT $nbt, bool $network = false){
|
||||||
$this->value = $nbt->getShort();
|
$this->value = $nbt->getSignedShort();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function write(NBT $nbt, bool $network = false){
|
public function write(NBT $nbt, bool $network = false){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user