33 public const NAME =
"PocketMine-MP";
34 public const BASE_VERSION =
"5.21.2";
35 public const IS_DEVELOPMENT_BUILD =
true;
36 public const BUILD_CHANNEL =
"stable";
47 public const WORLD_DATA_VERSION = 1;
51 public const TAG_WORLD_DATA_VERSION =
"PMMPDataVersion";
53 private function __construct(){
57 private static ?
string $gitHash =
null;
59 public static function GIT_HASH() : string{
60 if(self::$gitHash === null){
61 $gitHash = str_repeat(
"00", 20);
63 if(\Phar::running(
true) ===
""){
64 $gitHash = Git::getRepositoryStatePretty(\
pocketmine\PATH);
66 $pharPath = \Phar::running(
false);
67 $phar = \Phar::isValidPharFilename($pharPath) ? new \Phar($pharPath) : new \PharData($pharPath);
68 $meta = $phar->getMetadata();
69 if(isset($meta[
"git"])){
70 $gitHash = $meta[
"git"];
74 self::$gitHash = $gitHash;
77 return self::$gitHash;
80 private static ?
int $buildNumber =
null;
82 public static function BUILD_NUMBER() : int{
83 if(self::$buildNumber === null){
84 self::$buildNumber = 0;
85 if(\Phar::running(
true) !==
""){
86 $pharPath = \Phar::running(
false);
87 $phar = \Phar::isValidPharFilename($pharPath) ? new \Phar($pharPath) : new \PharData($pharPath);
88 $meta = $phar->getMetadata();
89 if(is_array($meta) && isset($meta[
"build"]) && is_int($meta[
"build"])){
90 self::$buildNumber = $meta[
"build"];
95 return self::$buildNumber;
98 private static ?VersionString $fullVersion =
null;
100 public static function VERSION() : VersionString{
101 if(self::$fullVersion === null){
102 self::$fullVersion =
new VersionString(self::BASE_VERSION, self::IS_DEVELOPMENT_BUILD, self::BUILD_NUMBER());
104 return self::$fullVersion;