Fix plugin provides not being listed behind name in /plugins (#4825)

This commit is contained in:
Max Lee 2020-12-01 15:06:14 +01:00 committed by GitHub
parent 9119af508c
commit 0081e8ef81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 16 additions and 36 deletions

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Make /plugins list alphabetical
diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
index bcb576a4271b1ec7b1cfe6f83cf161b7d89ed2e5..9b2e28d04be7a89bdd0fb27d1d1f3f71846edefb 100644
index bcb576a4271b1ec7b1cfe6f83cf161b7d89ed2e5..4de959bbd1270d7d6ea8e5e69521bcca6abe2138 100644
--- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
@@ -3,6 +3,9 @@ package org.bukkit.command.defaults;
@ -18,7 +18,7 @@ index bcb576a4271b1ec7b1cfe6f83cf161b7d89ed2e5..9b2e28d04be7a89bdd0fb27d1d1f3f71
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
@@ -34,23 +37,33 @@ public class PluginsCommand extends BukkitCommand {
@@ -34,15 +37,22 @@ public class PluginsCommand extends BukkitCommand {
@NotNull
private String getPluginList() {
@ -39,17 +39,13 @@ index bcb576a4271b1ec7b1cfe6f83cf161b7d89ed2e5..9b2e28d04be7a89bdd0fb27d1d1f3f71
pluginList.append(", ");
}
- pluginList.append(plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED);
- pluginList.append(plugin.getDescription().getName());
+ Plugin plugin = entry.getValue();
+
pluginList.append(plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED);
pluginList.append(plugin.getDescription().getName());
if (plugin.getDescription().getProvides().size() > 0) {
pluginList.append(" (").append(String.join(", ", plugin.getDescription().getProvides())).append(")");
@@ -51,6 +61,8 @@ public class PluginsCommand extends BukkitCommand {
}
+
+
+ pluginList.append(plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED);
+ pluginList.append(plugin.getDescription().getName());
}
- return "(" + plugins.length + "): " + pluginList.toString();

View File

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Thu, 19 Jul 2018 22:07:02 +0200
From: Phoenix616 <max@themoep.de>
Date: Tue, 1 Dec 2020 14:57:02 +0100
Subject: [PATCH] Add an asterisk to legacy API plugins
Not here to name and shame, only so server admins can be aware of which
@ -23,12 +23,15 @@ index 1b6d737046646c102b0d519ab3f67c3fbd503979..541e28a9bece0beb0c2cf02c39030840
// Paper end
}
diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
index 9b2e28d04be7a89bdd0fb27d1d1f3f71846edefb..fd74512a2bbbb0f198192b450e09bdbb9bac248d 100644
index 4de959bbd1270d7d6ea8e5e69521bcca6abe2138..1aa58c59e1e8738bbdc77752885ff3b18b29de42 100644
--- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
@@ -59,7 +59,13 @@ public class PluginsCommand extends BukkitCommand {
@@ -52,9 +52,15 @@ public class PluginsCommand extends BukkitCommand {
}
Plugin plugin = entry.getValue();
-
+
pluginList.append(plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED);
- pluginList.append(plugin.getDescription().getName());
+ // Paper start - Add an asterisk to legacy plugins (so admins are aware)
@ -38,9 +41,9 @@ index 9b2e28d04be7a89bdd0fb27d1d1f3f71846edefb..fd74512a2bbbb0f198192b450e09bdbb
+ }
+ pluginList.append(pluginName);
+ // Paper end
}
return "(" + plugins.size() + "): " + pluginList.toString();
if (plugin.getDescription().getProvides().size() > 0) {
pluginList.append(" (").append(String.join(", ", plugin.getDescription().getProvides())).append(")");
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index bef88a6e2e6f7071401a3af0aec31e62aa265566..de44d850d7b3ab3e528eb6f2de375a6c3e0e5cf9 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java

View File

@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aurora <aurora@relanet.eu>
Date: Sat, 3 Oct 2020 21:26:01 +0200
Subject: [PATCH] Remove unnecessary space for provided plugins
diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
index fd74512a2bbbb0f198192b450e09bdbb9bac248d..9e17a107947c401936ab0550508dd6fb93415d81 100644
--- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
@@ -54,7 +54,7 @@ public class PluginsCommand extends BukkitCommand {
Plugin plugin = entry.getValue();
if (plugin.getDescription().getProvides().size() > 0) {
- pluginList.append(" (").append(String.join(", ", plugin.getDescription().getProvides())).append(")");
+ pluginList.append("(").append(String.join(", ", plugin.getDescription().getProvides())).append(")"); // Paper - Remove unnecessary space
}