Fix version without patch not being detected on spigot/paper correctly

This commit is contained in:
Blue (Lukas Rieger) 2021-06-25 00:37:12 +02:00
parent 0818f945c8
commit 7d44a433d3
No known key found for this signature in database
GPG Key ID: 904C4995F9E1F800

View File

@ -74,7 +74,7 @@ public BukkitPlugin() {
//try to get best matching minecraft-version
try {
String versionString = getServer().getBukkitVersion();
Matcher versionMatcher = Pattern.compile("(\\d+\\.\\d+\\.\\d+)[-_].*").matcher(versionString);
Matcher versionMatcher = Pattern.compile("(\\d+(?:\\.\\d+){1,2})[-_].*").matcher(versionString);
if (!versionMatcher.matches()) throw new IllegalArgumentException();
version = MinecraftVersion.of(versionMatcher.group(1));
} catch (IllegalArgumentException e) {