1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-07 23:27:08 +02:00

change pattern match for essentials update

This commit is contained in:
ementalo
2012-06-26 11:36:54 +01:00
parent 451abd2bec
commit d1dad4fca5

View File

@@ -187,10 +187,10 @@ public class UpdateCheck
private int getBukkitVersion() private int getBukkitVersion()
{ {
final Matcher versionMatch = Pattern.compile("git-Bukkit-([0-9]+).([0-9]+).([0-9]+)-[0-9]+-[0-9a-z]+-b([0-9]+)jnks.*").matcher(plugin.getServer().getVersion()); final Matcher versionMatch = Pattern.compile("git-Bukkit-(?:(?:[0-9]+)\\.)+[0-9]+-R[\\.0-9]+-(?:[0-9]+-g[0-9a-f]+-)?b([0-9]+)jnks.*").matcher(plugin.getServer().getVersion());
if (versionMatch.matches()) if (versionMatch.matches())
{ {
return Integer.parseInt(versionMatch.group(4)); return Integer.parseInt(versionMatch.group(1));
} }
throw new NumberFormatException("Bukkit Version changed!"); throw new NumberFormatException("Bukkit Version changed!");
} }