Compare numbers not strings

This commit is contained in:
libraryaddict 2019-03-07 14:39:10 +13:00
parent d164ea36dc
commit 989afe3d31

View File

@ -112,12 +112,12 @@ public class LibsPremium {
} }
// Split by decimal points // Split by decimal points
String[] cSplit = currentVersion.split("\\."); String[] currentSplit = currentVersion.split("\\.");
String[] nSplit = premiumVersion.split("\\."); String[] premSplit = premiumVersion.split("\\.");
// Comparing major versions // Comparing major versions
// Current version must be the same, or lower than premium version // Current version must be the same, or lower than premium version
return cSplit[0].compareTo(nSplit[0]) <= 0; return Integer.parseInt(currentSplit[0]) <= Integer.parseInt(premSplit[0]);
} }
private static PluginInformation getInformation(File file) throws Exception { private static PluginInformation getInformation(File file) throws Exception {