Package forestry.plugins

Examples of forestry.plugins.Plugin


    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())
        sendChatMessage(sender, "\u00A79Author(s): " + info.author());
      if (!info.url().isEmpty())
        sendChatMessage(sender, "\u00A79URL: " + info.url());
      if (!info.unlocalizedDescription().isEmpty())
        sendChatMessage(sender, StatCollector.translateToLocal(info.unlocalizedDescription()));
    }

  }
View Full Code Here


  private String makeListEntry(ForestryPlugin plugin) {
    String entry = "\u00A7c";
    if (plugin.isAvailable())
      entry = "\u00A7a";

    Plugin info = plugin.getClass().getAnnotation(Plugin.class);
    if (info != null) {
      entry += info.pluginID();
      if (!info.version().isEmpty())
        entry += " (" + info.version() + ")";
    } else
      entry += "???";

    return entry;
  }
View Full Code Here

TOP

Related Classes of forestry.plugins.Plugin

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.