Package me.hackware.api.plugin
Class PluginMetadata
java.lang.Object
me.hackware.api.plugin.PluginMetadata
Contents of a plugin's descriptor, which must sit at the root of the plugin
jar as
hackware.plugin.json, hackware.plugin.yml or
hackware.plugin.yaml — same fields either way.
{
"id": "example",
"name": "Example",
"version": "1.0.0",
"apiVersion": 1,
"main": "com.example.ExamplePlugin",
"authors": ["you"],
"description": "Adds an example module."
}
Fields carry SerializedName per the project-wide GSON convention, so
the wire names survive obfuscation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAPI generation this client implements. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintPlugin API generation this plugin was built against.getId()Unique plugin id; also namespaces registered categories and the data directory.getMain()Fully-qualified name of thePluginimplementation.getName()Human-readable name shown in chat and the GUI; falls back to the id.toString()validate()Validates the required fields.
-
Field Details
-
CURRENT_API_VERSION
public static final int CURRENT_API_VERSIONAPI generation this client implements. A plugin declaring a differentgetApiVersion()is rejected at load with a clear message rather than being allowed to fail later withNoSuchMethodError.Bump this whenever a breaking change lands in the plugin-facing surface.
- See Also:
-
-
Constructor Details
-
PluginMetadata
public PluginMetadata()
-
-
Method Details
-
getId
Unique plugin id; also namespaces registered categories and the data directory. -
getName
Human-readable name shown in chat and the GUI; falls back to the id. -
getVersion
-
getApiVersion
public int getApiVersion()Plugin API generation this plugin was built against. -
getMain
Fully-qualified name of thePluginimplementation. -
getAuthors
-
getDescription
-
validate
Validates the required fields.- Returns:
- null when valid, otherwise a human-readable reason to report
-
toString
-