Package forestry.plugins

Examples of forestry.plugins.ForestryPlugin


  private void listPluginInfoForSender(ICommandSender sender, String[] arguments) {

    if (arguments.length < 3)
      throw new WrongUsageException("/" + getCommandName() + " plugins info <plugin-name>");

    ForestryPlugin found = null;
    for (PluginManager.Module pluginModule : PluginManager.getLoadedModules()) {
      Plugin info = pluginModule.instance().getClass().getAnnotation(Plugin.class);
      if (info == null)
        continue;

      if ((info.pluginID().equalsIgnoreCase(arguments[2]) || info.name().equalsIgnoreCase(arguments[2]))) {
        found = pluginModule.instance();
        break;
      }
    }

    if (found == null)
      throw new CommandException(StringUtil.localizeAndFormat("chat.plugins.error", arguments[2]));

    String entry = "\u00A7c";
    if (found.isAvailable())
      entry = "\u00A7a";
    Plugin info = found.getClass().getAnnotation(Plugin.class);
    if (info != null) {
      sendChatMessage(sender, entry + "Plugin: " + info.name());
      if (!info.version().isEmpty())
        sendChatMessage(sender, "\u00A79Version: " + info.version());
      if (!info.author().isEmpty())
View Full Code Here

TOP

Related Classes of forestry.plugins.ForestryPlugin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.