Added build revision
This commit is contained in:
@@ -17,6 +17,8 @@ public class Version{
|
||||
public static int number;
|
||||
/**Build number, e.g. '43'. set to '-1' for custom builds.*/
|
||||
public static int build = 0;
|
||||
/**Revision number. Used for hotfixes. Does not affect server compatibility.*/
|
||||
public static int revision = 0;
|
||||
|
||||
public static void init(){
|
||||
try{
|
||||
@@ -28,7 +30,18 @@ public class Version{
|
||||
type = map.get("type");
|
||||
number = Integer.parseInt(map.get("number"));
|
||||
modifier = map.get("modifier");
|
||||
build = Strings.canParseInt(map.get("build")) ? Integer.parseInt(map.get("build")) : -1;
|
||||
if(map.get("build").contains(".")){
|
||||
String[] split = map.get("build").split("\\.");
|
||||
try{
|
||||
build = Integer.parseInt(split[0]);
|
||||
revision = Integer.parseInt(split[1]);
|
||||
}catch(Throwable e){
|
||||
e.printStackTrace();
|
||||
build = -1;
|
||||
}
|
||||
}else{
|
||||
build = Strings.canParseInt(map.get("build")) ? Integer.parseInt(map.get("build")) : -1;
|
||||
}
|
||||
}catch(IOException e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user