1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Added Addons amount to /sf versions

This commit is contained in:
TheBusyBiscuit 2017-04-02 11:09:52 +02:00
parent af6ec415b0
commit 4650b92947

View File

@ -159,19 +159,29 @@ public class SlimefunCommand implements CommandExecutor, Listener {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&aCS-CoreLib &2v" + CSCoreLib.getLib().getDescription().getVersion())); sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&aCS-CoreLib &2v" + CSCoreLib.getLib().getDescription().getVersion()));
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&aSlimefun &2v" + plugin.getDescription().getVersion())); sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&aSlimefun &2v" + plugin.getDescription().getVersion()));
sender.sendMessage(""); sender.sendMessage("");
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&7&oInstalled Addons:"));
List<String> addons = new ArrayList<String>();
for (Plugin plugin: Bukkit.getPluginManager().getPlugins()) { for (Plugin plugin: Bukkit.getPluginManager().getPlugins()) {
if (plugin.getDescription().getDepend().contains("Slimefun") || plugin.getDescription().getSoftDepend().contains("Slimefun")) { if (plugin.getDescription().getDepend().contains("Slimefun") || plugin.getDescription().getSoftDepend().contains("Slimefun")) {
if (Bukkit.getPluginManager().isPluginEnabled(plugin)) { if (Bukkit.getPluginManager().isPluginEnabled(plugin)) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', " &a" + plugin.getName() + " &2v" + plugin.getDescription().getVersion())); addons.add(ChatColor.translateAlternateColorCodes('&', " &a" + plugin.getName() + " &2v" + plugin.getDescription().getVersion()));
} }
else { else {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', " &c" + plugin.getName() + " &4v" + plugin.getDescription().getVersion())); addons.add(ChatColor.translateAlternateColorCodes('&', " &c" + plugin.getName() + " &4v" + plugin.getDescription().getVersion()));
} }
} }
} }
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&7Installed Addons &8(" + addons.size() + ")"));
for (String addon: addons) {
sender.sendMessage(addon);
}
}
else {
Messages.local.sendTranslation(sender, "messages.no-permission", true);
} }
else Messages.local.sendTranslation(sender, "messages.no-permission", true);
} }
else if (args[0].equalsIgnoreCase("give")) { else if (args[0].equalsIgnoreCase("give")) {
if (args.length == 3) { if (args.length == 3) {