From ce979b29be0d445df5e8deb6c34637a89b37f11c Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 16 Jan 2021 02:46:43 +0000 Subject: [PATCH] Updated Upstream (Bukkit) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: b94b766f Improve /version command --- .../0008-Version-Command-2.0.patch | 17 ++++++++--------- work/Bukkit | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Spigot-API-Patches/0008-Version-Command-2.0.patch b/Spigot-API-Patches/0008-Version-Command-2.0.patch index ff98db6ad..3ad8a06bb 100644 --- a/Spigot-API-Patches/0008-Version-Command-2.0.patch +++ b/Spigot-API-Patches/0008-Version-Command-2.0.patch @@ -72,7 +72,7 @@ index 945b8b030d1b2a13afc0c4efad76997eb7bf00ba..1b6d737046646c102b0d519ab3f67c3f // Paper end } diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java -index abbd1c35f9ac55ea61e94dd19d44c82628d1cb99..a47ed6b290c051ff076900028b929745aac0ba55 100644 +index 2305eb40832a82159cd89162934870cf57e1aa0e..c1f64d31835bd9cd86f807c77cdb86190f4709b0 100644 --- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java +++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java @@ -1,5 +1,6 @@ @@ -120,21 +120,20 @@ index abbd1c35f9ac55ea61e94dd19d44c82628d1cb99..a47ed6b290c051ff076900028b929745 return; } versionWaiters.add(sender); -@@ -186,7 +196,12 @@ public class VersionCommand extends BukkitCommand { +@@ -186,6 +196,12 @@ public class VersionCommand extends BukkitCommand { private void obtainVersion() { String version = Bukkit.getVersion(); -- if (version == null) version = "Custom"; + // Paper start + if (version.startsWith("null")) { // running from ide? + setVersionMessage("Unknown version, custom build?"); + return; + } + /* - if (version.startsWith("git-Spigot-")) { - String[] parts = version.substring("git-Spigot-".length()).split("-"); - int cbVersions = getDistance("craftbukkit", parts[1].substring(0, parts[1].indexOf(' '))); -@@ -216,6 +231,9 @@ public class VersionCommand extends BukkitCommand { + if (version == null) version = "Custom"; + String[] parts = version.substring(0, version.indexOf(' ')).split("-"); + if (parts.length == 4) { +@@ -215,6 +231,9 @@ public class VersionCommand extends BukkitCommand { } else { setVersionMessage("Unknown version, custom build?"); } @@ -144,7 +143,7 @@ index abbd1c35f9ac55ea61e94dd19d44c82628d1cb99..a47ed6b290c051ff076900028b929745 } private void setVersionMessage(@NotNull String msg) { -@@ -225,8 +243,13 @@ public class VersionCommand extends BukkitCommand { +@@ -224,8 +243,13 @@ public class VersionCommand extends BukkitCommand { try { hasVersion = true; versionTaskStarted = false; @@ -159,7 +158,7 @@ index abbd1c35f9ac55ea61e94dd19d44c82628d1cb99..a47ed6b290c051ff076900028b929745 } versionWaiters.clear(); } finally { -@@ -234,6 +257,15 @@ public class VersionCommand extends BukkitCommand { +@@ -233,6 +257,15 @@ public class VersionCommand extends BukkitCommand { } } diff --git a/work/Bukkit b/work/Bukkit index 85b16b8a5..b94b766f2 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 85b16b8a5f044eb8d38375c23e8968641d18a933 +Subproject commit b94b766f2285a5b55720a8aa72605e2e64b0330a