mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
feat: Sort plugins on debugpaste (#1429)
* Replace plugins with an array and sort them by their name. Resolves #1428 * Use comparator Co-authored-by: Alex <mc.cache@web.de>
This commit is contained in:
parent
1e5e9e04b4
commit
fc4517fe4c
@ -47,6 +47,9 @@ import org.bukkit.plugin.PluginManager;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@ -148,9 +151,13 @@ public class FaweBukkit implements IFawe, Listener {
|
||||
@Override
|
||||
public String getDebugInfo() {
|
||||
StringBuilder msg = new StringBuilder();
|
||||
Plugin[] plugins = Bukkit.getServer().getPluginManager().getPlugins();
|
||||
|
||||
List<Plugin> plugins = new ArrayList<>();
|
||||
Collections.addAll(plugins, Bukkit.getServer().getPluginManager().getPlugins());
|
||||
plugins.sort(Comparator.comparing(Plugin::getName));
|
||||
|
||||
msg.append("Server Version: ").append(Bukkit.getVersion()).append("\n");
|
||||
msg.append("Plugins (").append(plugins.length).append("):\n");
|
||||
msg.append("Plugins (").append(plugins.size()).append("):\n");
|
||||
for (Plugin p : plugins) {
|
||||
msg.append(" - ").append(p.getName()).append(":").append("\n")
|
||||
.append(" • Version: ").append(p.getDescription().getVersion()).append("\n")
|
||||
|
Loading…
Reference in New Issue
Block a user