mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-06 16:27:59 +01:00
Fixed version checking
This commit is contained in:
parent
afef2dc927
commit
e27afceded
@ -37,17 +37,9 @@ public class VersionChecker {
|
|||||||
lVersion += s;
|
lVersion += s;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
version = Integer.parseInt(lVersion);
|
||||||
version = Integer.parseInt(lVersion);
|
|
||||||
} catch (Throwable e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
try {
|
version = Integer.parseInt(v);
|
||||||
version = Integer.parseInt(v);
|
|
||||||
} catch (Throwable e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
@ -148,9 +140,12 @@ public class VersionChecker {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||||
String currentVersion = plugin.getDescription().getVersion();
|
|
||||||
String newVersion = getNewVersion();
|
String newVersion = getNewVersion();
|
||||||
if (newVersion == null || newVersion.equalsIgnoreCase(currentVersion))
|
if (newVersion == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
String currentVersion = plugin.getDescription().getVersion();
|
||||||
|
if (Integer.parseInt(newVersion.replace(".", "")) <= Integer.parseInt(currentVersion.replace(".", "")))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
List<String> msg = Arrays.asList(
|
List<String> msg = Arrays.asList(
|
||||||
|
Loading…
Reference in New Issue
Block a user