From 4730b35c17736fcbec0cd8aec827de6605dceb0e Mon Sep 17 00:00:00 2001 From: asofold Date: Fri, 25 Dec 2015 00:58:23 +0100 Subject: [PATCH] Add cncp and ProtocolLib versions to 'ncp version' output. --- .../nocheatplus/command/admin/VersionCommand.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/command/admin/VersionCommand.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/command/admin/VersionCommand.java index 8451c40e..591f2ea0 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/command/admin/VersionCommand.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/command/admin/VersionCommand.java @@ -12,6 +12,7 @@ import java.util.Set; import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; +import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; import fr.neatmonster.nocheatplus.NCPAPIProvider; @@ -69,6 +70,16 @@ public class VersionCommand extends BaseCommand{ Collections.sort(fullNames, String.CASE_INSENSITIVE_ORDER); lines.add("Hooks: " + StringUtil.join(fullNames, " | ")); } + final List relatedPlugins = new LinkedList(); + for (final String name : new String[]{"CompatNoCheatPlus", "ProtocolLib"}) { + Plugin plugin = Bukkit.getPluginManager().getPlugin(name); + if (plugin != null) { + relatedPlugins.add(plugin.getDescription().getFullName()); + } + } + if (!relatedPlugins.isEmpty()) { + lines.add("Related plugins: " + StringUtil.join(relatedPlugins, " | ")); + } return lines; }