diff --git a/Spigot-API-Patches/Check-PaperSpigot-versions.patch b/Spigot-API-Patches/Check-PaperSpigot-versions.patch index d9750076eb..697f46751c 100644 --- a/Spigot-API-Patches/Check-PaperSpigot-versions.patch +++ b/Spigot-API-Patches/Check-PaperSpigot-versions.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> -Date: Sat, 27 Dec 2014 17:17:06 -0600 +Date: Sun, 28 Dec 2014 16:28:21 -0600 Subject: [PATCH] Check PaperSpigot versions @@ -13,28 +13,24 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 String version = Bukkit.getVersion(); if (version == null) version = "Custom"; - if (version.startsWith("git-Spigot-")) { -+ // PaperSpigot start - Add PaperSpigot version checking ++ // PaperSpigot start + if (version.startsWith("git-PaperSpigot-")) { + String[] parts = version.substring("git-PaperSpigot-".length()).split("-"); -+ int cbVersions = getDistance("craftbukkit", parts[1]); ++ int cbVersions = getDistance("craftbukkit", parts[1].substring(0, parts[1].indexOf(' '))); + int paperSpigotVersions = getDistance("paperspigot", parts[0]); -+ if (cbVersions == -1 || paperSpigotVersions == -1) -+ { ++ if (cbVersions == -1 || paperSpigotVersions == -1) { + setVersionMessage("Error obtaining version information"); -+ } else -+ { -+ if (cbVersions == 0 && paperSpigotVersions == 0) -+ { ++ } else { ++ if (cbVersions == 0 && paperSpigotVersions == 0) { + setVersionMessage("You are running the latest version"); -+ } else -+ { ++ } else { + setVersionMessage("You are " + (cbVersions + paperSpigotVersions) + " version(s) behind"); + } + } + } else if (version.startsWith("git-Spigot-")) { + // PaperSpigot end 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]); @@ -0,0 +0,0 @@ public class VersionCommand extends BukkitCommand { private static int getDistance(String repo, String hash) {