Adjust parsing of version.

This commit is contained in:
asofold 2012-09-15 17:32:19 +02:00
parent 2e9ae3aa83
commit 68e4d84a85

View File

@ -261,7 +261,8 @@ public class NoCheatPlus extends JavaPlugin implements Listener {
BufferedReader bufferedReader = null; BufferedReader bufferedReader = null;
updateAvailable = false; updateAvailable = false;
try { try {
final int currentVersion = Integer.parseInt(getDescription().getVersion().split("-b")[1]); final String[] split = getDescription().getVersion().split("-b");
final int currentVersion = Integer.parseInt(split[split.length - 1]);
final URL url = new URL("http://nocheatplus.org:8080/job/NoCheatPlus/lastSuccessfulBuild/api/json"); final URL url = new URL("http://nocheatplus.org:8080/job/NoCheatPlus/lastSuccessfulBuild/api/json");
final URLConnection connection = url.openConnection(); final URLConnection connection = url.openConnection();
connection.setReadTimeout(config.getInt(ConfPaths.MISCELLANEOUS_READTIMEOUT, 4) * 1000); connection.setReadTimeout(config.getInt(ConfPaths.MISCELLANEOUS_READTIMEOUT, 4) * 1000);