Class PluginInfo
java.lang.Object
group.worldstandard.pudel.api.PluginInfo
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the plugin author as defined in@Plugin(author = "...").String[]Gets the names of plugins this plugin depends on, as defined in@Plugin(dependencies = {"dep1", "dep2"}).Gets the plugin description as defined in@Plugin(description = "...").getName()Gets the plugin name as defined in@Plugin(name = "...").Gets the plugin version as defined in@Plugin(version = "...").
-
Constructor Details
-
PluginInfo
-
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 nameversion- the plugin versionauthor- the plugin authordescription- the plugin descriptiondependencies- array of required plugin names this plugin depends on
-
-
Method Details
-
getName
Gets the plugin name as defined in@Plugin(name = "...").- Returns:
- the plugin name
-
getVersion
Gets the plugin version as defined in@Plugin(version = "...").- Returns:
- the version string
-
getAuthor
Gets the plugin author as defined in@Plugin(author = "...").- Returns:
- the author name
-
getDescription
Gets the plugin description as defined in@Plugin(description = "...").- Returns:
- the description
-
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)
-