Пример #1
0
 @NonNull
 public static String getExtraVersion() {
   String ver = instance.getDescription().getVersion().toLowerCase();
   if (ver.contains("beta")) {
     String temp[] = ver.split(" ");
     if (temp.length >= 3 && temp[2].matches("\\d+")) { // 1.18 beta 2
       return "b" + temp[2];
     } else {
       return "b1";
     }
   } else if (ver.contains("dev")) {
     String temp[] = ver.split(" ");
     if (temp.length >= 3 && temp[2].matches("\\d+")) {
       return "d" + temp[2];
     } else {
       return "d1";
     }
   } else {
     return "";
   }
 }
Пример #2
0
 @NonNull
 public static String getMinorVersion() {
   return instance.getDescription().getVersion().split("\\D+")[1];
 }