|
17 | 17 | use pmmp\encoding\Byte;
|
18 | 18 | use pmmp\encoding\ByteBufferReader;
|
19 | 19 | use pmmp\encoding\ByteBufferWriter;
|
20 |
| -use pocketmine\utils\Binary; |
21 | 20 | use pocketmine\utils\Limits;
|
22 | 21 |
|
23 | 22 | final class SubChunkPositionOffset{
|
@@ -45,16 +44,16 @@ public function getYOffset() : int{ return $this->yOffset; }
|
45 | 44 | public function getZOffset() : int{ return $this->zOffset; }
|
46 | 45 |
|
47 | 46 | public static function read(ByteBufferReader $in) : self{
|
48 |
| - $xOffset = Binary::signByte(Byte::readUnsigned($in)); |
49 |
| - $yOffset = Binary::signByte(Byte::readUnsigned($in)); |
50 |
| - $zOffset = Binary::signByte(Byte::readUnsigned($in)); |
| 47 | + $xOffset = Byte::readSigned($in); |
| 48 | + $yOffset = Byte::readSigned($in); |
| 49 | + $zOffset = Byte::readSigned($in); |
51 | 50 |
|
52 | 51 | return new self($xOffset, $yOffset, $zOffset);
|
53 | 52 | }
|
54 | 53 |
|
55 | 54 | public function write(ByteBufferWriter $out) : void{
|
56 |
| - Byte::writeUnsigned($out, $this->xOffset); |
57 |
| - Byte::writeUnsigned($out, $this->yOffset); |
58 |
| - Byte::writeUnsigned($out, $this->zOffset); |
| 55 | + Byte::writeSigned($out, $this->xOffset); |
| 56 | + Byte::writeSigned($out, $this->yOffset); |
| 57 | + Byte::writeSigned($out, $this->zOffset); |
59 | 58 | }
|
60 | 59 | }
|
0 commit comments