From 7d38c8ccf631a1370e666b8fcae38b8d739e34d2 Mon Sep 17 00:00:00 2001 From: Sleaker Date: Wed, 25 Apr 2012 07:21:24 -0700 Subject: [PATCH] added chat info to vault-info command --- src/net/milkbowl/vault/Vault.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/net/milkbowl/vault/Vault.java b/src/net/milkbowl/vault/Vault.java index 9159abd..23f93a1 100644 --- a/src/net/milkbowl/vault/Vault.java +++ b/src/net/milkbowl/vault/Vault.java @@ -486,6 +486,17 @@ public class Vault extends JavaPlugin { } } + String registeredChats = null; + Collection> chats = this.getServer().getServicesManager().getRegistrations(Chat.class); + for (RegisteredServiceProvider chat : chats) { + Chat c = chat.getProvider(); + if (registeredChats == null) { + registeredChats = c.getName(); + } else { + registeredChats += ", " + c.getName(); + } + } + // Get Economy & Permission primary Services RegisteredServiceProvider rsp = getServer().getServicesManager().getRegistration(Economy.class); Economy econ = null; @@ -497,11 +508,16 @@ public class Vault extends JavaPlugin { if (rspp != null) { perm = rspp.getProvider(); } - + Chat chat = null; + RegisteredServiceProvider rspc = getServer().getServicesManager().getRegistration(Chat.class); + if (rspc != null) { + chat = rspc.getProvider(); + } // Send user some info! sender.sendMessage(String.format("[%s] Vault v%s Information", getDescription().getName(), getDescription().getVersion())); sender.sendMessage(String.format("[%s] Economy: %s [%s]", getDescription().getName(), econ == null ? "None" : econ.getName(), registeredEcons)); sender.sendMessage(String.format("[%s] Permission: %s [%s]", getDescription().getName(), perm == null ? "None" : perm.getName(), registeredPerms)); + sender.sendMessage(String.format("[%s] Chat: %s [%s]", getDescription().getName(), chat == null ? "None" : chat.getName(), registeredChats)); } /**