Class PluginInfo

java.lang.Object
group.worldstandard.pudel.api.PluginInfo

public class PluginInfo extends Object
Contains metadata about a Pudel plugin.

Plugin metadata is automatically populated from the @Plugin annotation on your plugin class:

@Plugin(name = "My Plugin", version = "1.0.0", author = "Author",
        description = "A cool plugin")
public class MyPlugin {
    // ...
}

Access at runtime via PluginContext.getInfo():

@OnEnable
public void onEnable(PluginContext context) {
    PluginInfo info = context.getInfo();
    context.log("info", "Loaded " + info.getName() + " v" + info.getVersion());
}

  • Constructor Details

    • PluginInfo

      public PluginInfo(String name, String version, String author, String description)
      Creates plugin info without dependencies.
      Parameters:
      name - the plugin name
      version - the plugin version
      author - the plugin author
      description - the plugin description
    • PluginInfo

      public PluginInfo(String name, String version, String author, String description, String[] dependencies)
      Creates plugin info with all fields including dependencies.
      Parameters:
      name - the plugin name
      version - the plugin version
      author - the plugin author
      description - the plugin description
      dependencies - array of required plugin names this plugin depends on
  • Method Details

    • getName

      public String getName()
      Gets the plugin name as defined in @Plugin(name = "...").
      Returns:
      the plugin name
    • getVersion

      public String getVersion()
      Gets the plugin version as defined in @Plugin(version = "...").
      Returns:
      the version string
    • getAuthor

      public String getAuthor()
      Gets the plugin author as defined in @Plugin(author = "...").
      Returns:
      the author name
    • getDescription

      public String getDescription()
      Gets the plugin description as defined in @Plugin(description = "...").
      Returns:
      the description
    • getDependencies

      public String[] getDependencies()
      Gets the names of plugins this plugin depends on, as defined in @Plugin(dependencies = {"dep1", "dep2"}).
      Returns:
      array of dependency plugin names (never null)