Do not send plugin headers when it is not required (#8889)

This commit is contained in:
Jakubk15 2023-02-23 00:59:42 +01:00 committed by GitHub
parent 87bb3e6f4c
commit 062028941f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View file

@ -54,4 +54,5 @@ vytskalt <vytskalt@protonmail.com>
TheFruxz <cedricspitzer@outlook.de>
Kieran Wallbanks <kieran.wallbanks@gmail.com>
Denery <dorofeevij@gmail.com>
Jakubk15 <jakubk15@protonmail.com>
```

View file

@ -37,10 +37,10 @@ index 6a00f3d38da8107825ab1d405f337fd077b09f72..d44d0074446c1c54e87dc8078dff7fef
}
diff --git a/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java b/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..72096a66a4046633de73a12f5a043ac6dff169b1
index 0000000000000000000000000000000000000000..f0fce4113fb07c64adbec029d177c236cbdcbae8
--- /dev/null
+++ b/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java
@@ -0,0 +1,207 @@
@@ -0,0 +1,215 @@
+package io.papermc.paper.command;
+
+import com.google.common.collect.Lists;
@ -229,11 +229,19 @@ index 0000000000000000000000000000000000000000..72096a66a4046633de73a12f5a043ac6
+ //.append(INFO_ICON_START.hoverEvent(SERVER_PLUGIN_INFO)); TODO: Add docs
+
+ sender.sendMessage(infoMessage);
+ sender.sendMessage(PAPER_HEADER);
+
+ if (!paperPlugins.isEmpty()) {
+ sender.sendMessage(PAPER_HEADER);
+ }
+
+ for (Component component : formatProviders(paperPlugins)) {
+ sender.sendMessage(component);
+ }
+ sender.sendMessage(BUKKIT_HEADER);
+
+ if (!spigotPlugins.isEmpty()) {
+ sender.sendMessage(BUKKIT_HEADER);
+ }
+
+ for (Component component : formatProviders(spigotPlugins)) {
+ sender.sendMessage(component);
+ }