ResourcePackManager API
ResourcePackManager exposes a Java API that lets other plugins register their resource packs for merging at runtime.
Accessing the API
The API class is com.magmaguy.resourcepackmanager.api.ResourcePackManagerAPI. All methods are static.
Registering a Resource Pack
There are three registration methods depending on whether your pack is local, remote, or either.
registerResourcePack
ResourcePackManagerAPI.registerResourcePack(
String pluginName,
String localPath,
String url,
boolean encrypts,
boolean distributes,
boolean zips,
String reloadCommand
);
Registers a resource pack that can come from a local path or a remote URL. Exactly one of localPath or url should be non-null.
registerLocalResourcePack
ResourcePackManagerAPI.registerLocalResourcePack(
String pluginName,
String localPath,
boolean encrypts,
boolean distributes,
boolean zips,
String reloadCommand
);
Registers a resource pack from a local path relative to the plugins directory.
registerRemoteResourcePack
ResourcePackManagerAPI.registerRemoteResourcePack(
String pluginName,
String url,
boolean encrypts,
boolean distributes,
boolean zips,
String reloadCommand
);
Registers a resource pack that will be downloaded from the provided URL.
Parameters
| Parameter | Description |
|---|---|
pluginName | The name of your plugin exactly as it appears in the plugin list. Case-sensitive. |
localPath | Relative path from the plugins directory to your resource pack file or folder. |
url | URL to download the resource pack from. |
encrypts | Reserved for future use. Currently does nothing. |
distributes | Reserved for future use. Currently does nothing. |
zips | Whether the resource pack is already zipped. If false, ResourcePackManager will zip it before merging. |
reloadCommand | The reload command for your plugin. Reserved for future use. |
Triggering a Reload
ResourcePackManagerAPI.reloadResourcePack();
Reloads ResourcePackManager, which re-merges all registered packs and re-hosts the result if auto-hosting is enabled.
Notes
- Packs registered through the API participate in
priorityOrderthe same way built-in integrations do. Add your plugin name topriorityOrderinconfig.ymlto control where it sits in the merge order. - If your plugin name is not listed in
priorityOrder, your pack receives the lowest priority. - Registration should happen during your plugin's
onEnableor initialization, before ResourcePackManager finishes its own initialization and triggers the first merge.