From 5378ab45793b5a35cc05db2014036865ca15a1b9 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 28 Dec 2014 11:12:57 +0000 Subject: [PATCH] Fix the version checker By: Thinkofdeath --- .../java/org/bukkit/command/defaults/VersionCommand.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/VersionCommand.java index 7062946864..b55abdbffd 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/VersionCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/VersionCommand.java @@ -187,7 +187,7 @@ public class VersionCommand extends BukkitCommand { if (version == null) version = "Custom"; if (version.startsWith("git-Spigot-")) { String[] parts = version.substring("git-Spigot-".length()).split("-"); - int cbVersions = getDistance("craftbukkit", parts[1]); + int cbVersions = getDistance("craftbukkit", parts[1].substring(0, parts[1].indexOf(' '))); int spigotVersions = getDistance("spigot", parts[0]); if (cbVersions == -1 || spigotVersions == -1) { setVersionMessage("Error obtaining version information"); @@ -200,7 +200,8 @@ public class VersionCommand extends BukkitCommand { } } else if (version.startsWith("git-Bukkit-")) { - int cbVersions = getDistance("craftbukkit", version.substring("git-Bukkit-".length())); + version = version.substring("git-Bukkit-".length()); + int cbVersions = getDistance("craftbukkit", version.substring(0, version.indexOf(' '))); if (cbVersions == -1) { setVersionMessage("Error obtaining version information"); } else {