diff --git a/src/block/utils/BlockStateBinaryEncoder.php b/src/block/utils/BlockStateBinaryEncoder.php new file mode 100644 index 000000000..27b051083 --- /dev/null +++ b/src/block/utils/BlockStateBinaryEncoder.php @@ -0,0 +1,28 @@ + 0x7fff){ //signed short range + throw new \InvalidArgumentException("ID must be in range " . -0x8000 . " - " . 0x7fff); + } + $this->id = $id; + $this->meta = $meta !== -1 ? $meta & 0x7FFF : -1; + } + + public function getId() : int{ + return $this->id; + } + + public function getMeta() : int{ + return $this->meta; + } +}