BlockStateData: added getVersionAsString()

This commit is contained in:
Dylan K. Taylor 2023-03-13 16:14:19 +00:00
parent f03afba10e
commit a123194368
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -80,6 +80,14 @@ final class BlockStateData{
public function getVersion() : int{ return $this->version; }
public function getVersionAsString() : string{
$major = ($this->version >> 24) & 0xff;
$minor = ($this->version >> 16) & 0xff;
$patch = ($this->version >> 8) & 0xff;
$revision = $this->version & 0xff;
return "$major.$minor.$patch.$revision";
}
/**
* @throws BlockStateDeserializeException
*/