Skip to content
Permalink
Browse files

Now /plugins uses plugin name, instead of type name

  • Loading branch information...
UnknownShadow200 committed May 21, 2017
1 parent 29cf24e commit cfb6a88648580a31775cfdcb053829cad51b6ec9
Showing with 9 additions and 17 deletions.
  1. +9 −17 fCraft/Commands/InfoCommands.cs
@@ -2066,23 +2066,15 @@ static void clpHandler(Player player, CommandReader cmd)
Permissions = new Permission[] { Permission.Chat },
IsConsoleSafe = true,
Usage = "/Plugins",
Help = "Displays all plugins on the server.",
Handler = PluginsHandler
};

static void PluginsHandler(Player player, CommandReader cmd) {
List<string> plugins = new List<string>();
player.Message("&c_Current plugins on {0}&c_", ConfigKey.ServerName.GetString());

//Sloppy :P, PluginManager.Plugins adds ".Init", so this should split the ".Init" from the plugin name
foreach (Plugin plugin in PluginManager.Plugins) {
String pluginString = plugin.ToString();
string[] splitPluginString = pluginString.Split('.');
plugins.Add(splitPluginString[0]);
}
player.Message(String.Join(", ", plugins.ToArray()));
}
#endregion
Help = "Displays all plugins on the server.",
Handler = PluginsHandler
};

static void PluginsHandler(Player player, CommandReader cmd) {
player.Message("Plugins in {0}&S:", ConfigKey.ServerName.GetString());
player.Message(PluginManager.Plugins.JoinToString(plugin => plugin.Name));
}
#endregion
#region PingList

static readonly CommandDescriptor CdPingList = new CommandDescriptor {

0 comments on commit cfb6a88

Please sign in to comment.
You can’t perform that action at this time.