Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2024-10-13 22:57:59 -04:00
3 changed files with 357 additions and 298 deletions

View File

@@ -12,6 +12,8 @@ public class Version{
public static String type = "unknown";
/** Build modifier, e.g. 'alpha' or 'release' */
public static String modifier = "unknown";
/** Git commit hash (short) */
public static String commitHash = "unknown";
/** Number specifying the major version, e.g. '4' */
public static int number;
/** Build number, e.g. '43'. set to '-1' for custom builds. */
@@ -32,6 +34,7 @@ public class Version{
type = map.get("type");
number = Integer.parseInt(map.get("number", "4"));
modifier = map.get("modifier");
commitHash = map.get("commitHash");
if(map.get("build").contains(".")){
String[] split = map.get("build").split("\\.");
try{
@@ -73,6 +76,6 @@ public class Version{
if(build == -1){
return "custom build";
}
return (type.equals("official") ? modifier : type) + " build " + build + (revision == 0 ? "" : "." + revision);
return (type.equals("official") ? modifier : type) + " build " + build + (revision == 0 ? "" : "." + revision) + (commitHash.equals("unknown") ? "" : " (" + commitHash + ")");
}
}