-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
always output bukkit/paper plugin header in plugin command
- Loading branch information
Showing
1 changed file
with
20 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ Co-authored-by: Oharass <[email protected]> | |
Co-authored-by: granny <[email protected]> | ||
|
||
diff --git a/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java b/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java | ||
index f0fce4113fb07c64adbec029d177c236cbdcbae8..e94224ed280247ee69dfdff8dc960f2b8729be33 100644 | ||
index f0fce4113fb07c64adbec029d177c236cbdcbae8..865dc183276720d54d31d2a54d1bb5c845e80598 100644 | ||
--- a/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java | ||
+++ b/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java | ||
@@ -78,10 +78,10 @@ public class PaperPluginsCommand extends BukkitCommand { | ||
|
@@ -32,7 +32,7 @@ index f0fce4113fb07c64adbec029d177c236cbdcbae8..e94224ed280247ee69dfdff8dc960f2b | |
TextComponent.Builder builder = Component.text(); | ||
if (provider instanceof SpigotPluginProvider spigotPluginProvider && CraftMagicNumbers.isLegacy(spigotPluginProvider.getMeta())) { | ||
builder.append(LEGACY_PLUGIN_STAR); | ||
@@ -117,12 +117,64 @@ public class PaperPluginsCommand extends BukkitCommand { | ||
@@ -117,13 +117,65 @@ public class PaperPluginsCommand extends BukkitCommand { | ||
|
||
String name = provider.getMeta().getName(); | ||
Component pluginName = Component.text(name, fromStatus(provider)) | ||
|
@@ -71,13 +71,13 @@ index f0fce4113fb07c64adbec029d177c236cbdcbae8..e94224ed280247ee69dfdff8dc960f2b | |
+ | ||
+ pluginName.hoverEvent(hover.build()); | ||
+ } | ||
+ // Purpur end | ||
|
||
builder.append(pluginName); | ||
+ // Purpur end | ||
+ | ||
+ return builder.build(); | ||
+ } | ||
+ | ||
|
||
return builder.build(); | ||
} | ||
|
||
+ // Purpur start | ||
+ @NotNull | ||
+ private static TextComponent getAuthors(@NotNull final PluginMeta pluginMeta) { | ||
|
@@ -91,13 +91,14 @@ index f0fce4113fb07c64adbec029d177c236cbdcbae8..e94224ed280247ee69dfdff8dc960f2b | |
+ | ||
+ builder.append(Component.text(authors.get(i), NamedTextColor.GREEN)); | ||
+ } | ||
return builder.build(); | ||
} | ||
+ | ||
+ return builder.build(); | ||
+ } | ||
+ // Purpur end | ||
+ | ||
private static Component asPlainComponents(String strings) { | ||
net.kyori.adventure.text.TextComponent.Builder builder = Component.text(); | ||
for (String string : strings.split("\n")) { | ||
@@ -182,24 +234,24 @@ public class PaperPluginsCommand extends BukkitCommand { | ||
} | ||
} | ||
|
@@ -109,20 +110,24 @@ index f0fce4113fb07c64adbec029d177c236cbdcbae8..e94224ed280247ee69dfdff8dc960f2b | |
- sender.sendMessage(infoMessage); | ||
+ //sender.sendMessage(infoMessage); // Purpur | ||
|
||
if (!paperPlugins.isEmpty()) { | ||
- if (!paperPlugins.isEmpty()) { | ||
- sender.sendMessage(PAPER_HEADER); | ||
- } | ||
+ //if (!paperPlugins.isEmpty()) { // Purpur | ||
+ sender.sendMessage(PAPER_HEADER.append(Component.text(" (%s):".formatted(paperPlugins.size())))); // Purpur | ||
} | ||
+ //} // Purpur | ||
|
||
- for (Component component : formatProviders(paperPlugins)) { | ||
+ for (Component component : formatProviders(paperPlugins, sender)) { // Purpur | ||
sender.sendMessage(component); | ||
} | ||
|
||
if (!spigotPlugins.isEmpty()) { | ||
- if (!spigotPlugins.isEmpty()) { | ||
- sender.sendMessage(BUKKIT_HEADER); | ||
- } | ||
+ //if (!spigotPlugins.isEmpty()) { // Purpur | ||
+ sender.sendMessage(BUKKIT_HEADER.append(Component.text(" (%s):".formatted(spigotPlugins.size())))); // Purpur | ||
} | ||
+ //} // Purpur | ||
|
||
- for (Component component : formatProviders(spigotPlugins)) { | ||
+ for (Component component : formatProviders(spigotPlugins, sender)) { // Purpur | ||
|