From 3ac51e1095279f53cea19427f0c50748a2c40005 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 2 Jun 2017 11:30:44 +0100 Subject: [PATCH] TAG_Byte should always be signed (#962) --- src/pocketmine/nbt/NBT.php | 4 ++-- src/pocketmine/nbt/tag/ByteTag.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pocketmine/nbt/NBT.php b/src/pocketmine/nbt/NBT.php index 1c238adc5..1e0b5b6ec 100644 --- a/src/pocketmine/nbt/NBT.php +++ b/src/pocketmine/nbt/NBT.php @@ -267,8 +267,8 @@ class NBT{ $tag->write($this, $network); } - public function getByte(){ - return Binary::readByte($this->get(1)); + public function getByte(bool $signed = false){ + return Binary::readByte($this->get(1), $signed); } public function putByte($v){ diff --git a/src/pocketmine/nbt/tag/ByteTag.php b/src/pocketmine/nbt/tag/ByteTag.php index 4b7119a4c..33f9cfbee 100644 --- a/src/pocketmine/nbt/tag/ByteTag.php +++ b/src/pocketmine/nbt/tag/ByteTag.php @@ -32,7 +32,7 @@ class ByteTag extends NamedTag{ } public function read(NBT $nbt, bool $network = false){ - $this->value = $nbt->getByte(); + $this->value = $nbt->getByte(true); } public function write(NBT $nbt, bool $network = false){