diff --git a/core/src/mindustry/mod/Mods.java b/core/src/mindustry/mod/Mods.java index 22910afb1e..e73dc85b9c 100644 --- a/core/src/mindustry/mod/Mods.java +++ b/core/src/mindustry/mod/Mods.java @@ -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