mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 17:18:37 +01:00
Fix version regex on 1.14.3 (#2622) @JRoy
This commit is contained in:
parent
9089fe8be3
commit
8ff1ebd7c2
@ -23,8 +23,9 @@ public class VersionUtil {
|
||||
public static final BukkitVersion v1_14_R01 = BukkitVersion.fromString("1.14-R0.1-SNAPSHOT");
|
||||
public static final BukkitVersion v1_14_1_R01 = BukkitVersion.fromString("1.14.1-R0.1-SNAPSHOT");
|
||||
public static final BukkitVersion v1_14_2_R01 = BukkitVersion.fromString("1.14.2-R0.1-SNAPSHOT");
|
||||
public static final BukkitVersion v1_14_3 = BukkitVersion.fromString("1.14.3-SNAPSHOT");
|
||||
|
||||
private static final Set<BukkitVersion> supportedVersions = ImmutableSet.of(v1_8_8_R01, v1_9_4_R01, v1_10_2_R01, v1_11_2_R01, v1_12_2_R01, v1_13_2_R01, v1_14_2_R01);
|
||||
private static final Set<BukkitVersion> supportedVersions = ImmutableSet.of(v1_8_8_R01, v1_9_4_R01, v1_10_2_R01, v1_11_2_R01, v1_12_2_R01, v1_13_2_R01, v1_14_3);
|
||||
|
||||
private static BukkitVersion serverVersion = null;
|
||||
|
||||
@ -40,7 +41,7 @@ public class VersionUtil {
|
||||
}
|
||||
|
||||
public static class BukkitVersion implements Comparable<BukkitVersion> {
|
||||
private static final Pattern VERSION_PATTERN = Pattern.compile("^(\\d+)\\.(\\d+)\\.?([0-9]*)?-(?:pre(\\d))?-?R?([\\d.]+)?(?:-SNAPSHOT)?");
|
||||
private static final Pattern VERSION_PATTERN = Pattern.compile("^(\\d+)\\.(\\d+)\\.?([0-9]*)?(?:-pre(\\d))?(?:-?R?([\\d.]+))?(?:-SNAPSHOT)?");
|
||||
|
||||
private final int major;
|
||||
private final int minor;
|
||||
|
@ -216,5 +216,11 @@ public class UtilTest extends TestCase {
|
||||
assertEquals(v.getPatch(), 2);
|
||||
assertEquals(v.getRevision(), 0.1);
|
||||
assertEquals(v.getPrerelease(), 1);
|
||||
v = VersionUtil.BukkitVersion.fromString("1.14.3-SNAPSHOT");
|
||||
assertEquals(v.getMajor(), 1);
|
||||
assertEquals(v.getMinor(), 14);
|
||||
assertEquals(v.getPatch(), 3);
|
||||
assertEquals(v.getRevision(), 0.0);
|
||||
assertEquals(v.getPrerelease(), -1);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user