mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-10 18:57:39 +07:00
Mod version parse fix
This commit is contained in:
parent
9b6c125233
commit
0cc9b0b0a3
@ -720,11 +720,7 @@ public class Mods implements Loadable{
|
||||
public boolean isSupported(){
|
||||
if(isOutdated()) return false;
|
||||
|
||||
int major = getMinMajor(), minor = getMinMinor();
|
||||
|
||||
if(Version.build <= 0) return true;
|
||||
|
||||
return Version.build >= major && Version.revision >= minor;
|
||||
return Version.isAtLeast(meta.minGameVersion);
|
||||
}
|
||||
|
||||
/** @return whether this mod is outdated, e.g. not compatible with v6. */
|
||||
@ -734,33 +730,9 @@ public class Mods implements Loadable{
|
||||
}
|
||||
|
||||
public int getMinMajor(){
|
||||
int major = 0;
|
||||
|
||||
String ver = meta.minGameVersion == null ? "0" : meta.minGameVersion;
|
||||
|
||||
if(ver.contains(".")){
|
||||
String[] split = ver.split("\\.");
|
||||
if(split.length == 2){
|
||||
major = Strings.parseInt(split[0], 0);
|
||||
}
|
||||
}else{
|
||||
major = Strings.parseInt(ver, 0);
|
||||
}
|
||||
|
||||
return major;
|
||||
}
|
||||
|
||||
public int getMinMinor(){
|
||||
String ver = meta.minGameVersion == null ? "0" : meta.minGameVersion;
|
||||
|
||||
if(ver.contains(".")){
|
||||
String[] split = ver.split("\\.");
|
||||
if(split.length == 2){
|
||||
return Strings.parseInt(split[1], 0);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
int dot = ver.indexOf(".");
|
||||
return dot != -1 ? Strings.parseInt(ver.substring(0, dot), 0) : Strings.parseInt(ver, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user