Skip to content

Commit 62174c6

Browse files
committed
Fix version detection from spigot
1 parent 6032043 commit 62174c6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlugin.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ public BukkitPlugin() {
8080
Matcher versionMatcher = Pattern.compile("(\\d+(?:\\.\\d+){1,2})[-_].*").matcher(versionString);
8181
if (!versionMatcher.matches()) throw new IllegalArgumentException();
8282
version = versionMatcher.group(1);
83+
84+
// minecraft omits .0 in its versions (e.g. 1.21 instead of 1.21.0) so we should remove it as well
85+
if (version.endsWith(".0"))
86+
version = version.substring(0, version.length() - 2);
87+
8388
} catch (IllegalArgumentException e) {
8489
Logger.global.logWarning("Failed to detect the minecraft version of this server! Using latest version.");
8590
}

0 commit comments

Comments
 (0)