From 8ce6a36fe7e6d4d3e7fa1d0f8b5a1812cb1134d5 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 29 Oct 2026 21:07:25 +0000 Subject: [PATCH] Restore /version and its tab completion --- .../defaults/VersionCommand.java.patch | 90 +------------------ 1 file changed, 2 insertions(+), 88 deletions(-) diff --git a/patches/org/bukkit/command/defaults/VersionCommand.java.patch b/patches/org/bukkit/command/defaults/VersionCommand.java.patch index 4025639b..3b557b01 100644 --- a/patches/org/bukkit/command/defaults/VersionCommand.java.patch +++ b/patches/org/bukkit/command/defaults/VersionCommand.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/org/bukkit/command/defaults/VersionCommand.java +++ ../src-work/minecraft/org/bukkit/command/defaults/VersionCommand.java -@@ -29,43 +29,21 @@ +@@ -29,7 +29,9 @@ if (!testPermission(sender)) return true; if (args.length == 0) { @@ -9,91 +9,5 @@ + "This server is running Crucible | https://github.com/CrucibleMC/Crucible | %s | %s", + Bukkit.getBukkitVersion(), Bukkit.getVersion())); } else { -- StringBuilder name = new StringBuilder(); + StringBuilder name = new StringBuilder(); -- for (String arg : args) { -- if (name.length() > 0) { -- name.append(' '); -- } -- -- name.append(arg); -+ if (true) { -+ sender.sendMessage("This server is not running any plugins."); - } -- -- String pluginName = name.toString(); -- Plugin exactPlugin = Bukkit.getPluginManager().getPlugin(pluginName); -- if (exactPlugin != null) { -- describeToSender(exactPlugin, sender); -- return true; -- } -- -- boolean found = false; -- pluginName = pluginName.toLowerCase(); -- for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) { -- if (plugin.getName().toLowerCase().contains(pluginName)) { -- describeToSender(plugin, sender); -- found = true; -- } -- } -- -- if (!found) { -- sender.sendMessage("This server is not running any plugin by that name."); -- sender.sendMessage("Use /plugins to get a list of plugins."); -- } - } - return true; - } - - private void describeToSender(Plugin plugin, CommandSender sender) { -+ sender.sendMessage("Author: Fracica"); -+/* - PluginDescriptionFile desc = plugin.getDescription(); - sender.sendMessage(ChatColor.GREEN + desc.getName() + ChatColor.WHITE + " version " + ChatColor.GREEN + desc.getVersion()); - -@@ -84,12 +62,12 @@ - sender.sendMessage("Authors: " + getAuthors(desc)); - } - } -+*/ - } - - private String getAuthors(final PluginDescriptionFile desc) { -- StringBuilder result = new StringBuilder(); -- List authors = desc.getAuthors(); -- -+ return "Fracica"; -+/* - for (int i = 0; i < authors.size(); i++) { - if (result.length() > 0) { - result.append(ChatColor.WHITE); -@@ -105,7 +83,7 @@ - result.append(authors.get(i)); - } - -- return result.toString(); -+ return result.toString();*/ - } - - @Override -@@ -113,9 +91,10 @@ - Validate.notNull(sender, "Sender cannot be null"); - Validate.notNull(args, "Arguments cannot be null"); - Validate.notNull(alias, "Alias cannot be null"); -- -- if (args.length == 1) { - List completions = new ArrayList(); -+ completions.add("None");return completions; -+ -+/* if (args.length == 1) { - String toComplete = args[0].toLowerCase(); - for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) { - if (StringUtil.startsWithIgnoreCase(plugin.getName(), toComplete)) { -@@ -124,6 +103,6 @@ - } - return completions; - } -- return ImmutableList.of(); -+ return ImmutableList.of();*/ - } - }