Fix version matching.

This commit is contained in:
KHobbits 2012-03-01 21:47:01 +00:00
parent dae69622a5
commit b0552019f5

View File

@ -129,10 +129,10 @@ public class Essentials extends JavaPlugin implements IEssentials
LOGGER.log(Level.WARNING, _("versionMismatch", plugin.getDescription().getName())); LOGGER.log(Level.WARNING, _("versionMismatch", plugin.getDescription().getName()));
} }
} }
final Matcher versionMatch = Pattern.compile("git-Bukkit-([0-9]+).([0-9]+).([0-9]+)-R[0-9]+-(?:[0-9]+-g[0-9a-f]+-)?b([0-9]+)jnks.*").matcher(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(getServer().getVersion());
if (versionMatch.matches()) if (versionMatch.matches())
{ {
final int versionNumber = Integer.parseInt(versionMatch.group(4)); final int versionNumber = Integer.parseInt(versionMatch.group(1));
if (versionNumber < BUKKIT_VERSION) if (versionNumber < BUKKIT_VERSION)
{ {
LOGGER.log(Level.SEVERE, _("notRecommendedBukkit")); LOGGER.log(Level.SEVERE, _("notRecommendedBukkit"));