Update version command

This commit is contained in:
Shane Freeder 2019-12-10 23:34:36 +00:00
parent bb8b1e3eca
commit 53c1345e48
No known key found for this signature in database
GPG key ID: A3F61EA5A085289C

View file

@ -1,4 +1,4 @@
From ee371574e60d48deec48728d90765e89fbc2532a Mon Sep 17 00:00:00 2001 From b23ef215ad1b3b0fa3048ea44fd244d0e42164a6 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io> From: Zach Brown <zach@zachbr.io>
Date: Mon, 27 May 2019 01:10:06 -0500 Date: Mon, 27 May 2019 01:10:06 -0500
Subject: [PATCH] Version Command 2.0 Subject: [PATCH] Version Command 2.0
@ -72,7 +72,7 @@ index 72c5501e..c0ff133d 100644
// Paper end // Paper end
} }
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
index 9d8360f7..9a3bb0e9 100644 index 9d8360f7..b3345cba 100644
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java --- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java +++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -98,7 +98,17 @@ index 9d8360f7..9a3bb0e9 100644
public VersionCommand(@NotNull String name) { public VersionCommand(@NotNull String name) {
super(name); super(name);
@@ -151,18 +161,18 @@ public class VersionCommand extends BukkitCommand { @@ -41,8 +51,7 @@ public class VersionCommand extends BukkitCommand {
if (args.length == 0) {
sender.sendMessage("This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")");
- sender.sendMessage(ChatColor.YELLOW + "This is a final build for 1.14.4. Please see https://www.spigotmc.org/go/1.14.4 for details about upgrading.");
- // sendVersion(sender);
+ sendVersion(sender); // Paper - Not dead yet, Jim!
} else {
StringBuilder name = new StringBuilder();
@@ -151,18 +160,18 @@ public class VersionCommand extends BukkitCommand {
private void sendVersion(@NotNull CommandSender sender) { private void sendVersion(@NotNull CommandSender sender) {
if (hasVersion) { if (hasVersion) {
@ -120,7 +130,7 @@ index 9d8360f7..9a3bb0e9 100644
return; return;
} }
versionWaiters.add(sender); versionWaiters.add(sender);
@@ -184,7 +194,12 @@ public class VersionCommand extends BukkitCommand { @@ -184,7 +193,12 @@ public class VersionCommand extends BukkitCommand {
private void obtainVersion() { private void obtainVersion() {
String version = Bukkit.getVersion(); String version = Bukkit.getVersion();
@ -134,7 +144,7 @@ index 9d8360f7..9a3bb0e9 100644
if (version.startsWith("git-Spigot-")) { if (version.startsWith("git-Spigot-")) {
String[] parts = version.substring("git-Spigot-".length()).split("-"); String[] parts = version.substring("git-Spigot-".length()).split("-");
int cbVersions = getDistance("craftbukkit", parts[1].substring(0, parts[1].indexOf(' '))); int cbVersions = getDistance("craftbukkit", parts[1].substring(0, parts[1].indexOf(' ')));
@@ -214,6 +229,9 @@ public class VersionCommand extends BukkitCommand { @@ -214,6 +228,9 @@ public class VersionCommand extends BukkitCommand {
} else { } else {
setVersionMessage("Unknown version, custom build?"); setVersionMessage("Unknown version, custom build?");
} }
@ -144,7 +154,7 @@ index 9d8360f7..9a3bb0e9 100644
} }
private void setVersionMessage(@NotNull String msg) { private void setVersionMessage(@NotNull String msg) {
@@ -223,8 +241,13 @@ public class VersionCommand extends BukkitCommand { @@ -223,8 +240,13 @@ public class VersionCommand extends BukkitCommand {
try { try {
hasVersion = true; hasVersion = true;
versionTaskStarted = false; versionTaskStarted = false;
@ -159,7 +169,7 @@ index 9d8360f7..9a3bb0e9 100644
} }
versionWaiters.clear(); versionWaiters.clear();
} finally { } finally {
@@ -232,6 +255,15 @@ public class VersionCommand extends BukkitCommand { @@ -232,6 +254,15 @@ public class VersionCommand extends BukkitCommand {
} }
} }