-
Notifications
You must be signed in to change notification settings - Fork 8
Plugin Docs: Plugin Registration
Simply implementing a plugin interface in a class will not make MoreMcmeta load the plugin; every plugin needs to be registered. How a plugin is registered depends on the mod loader. This page describes methods all plugins must implement, as well as how plugins must be registered on Fabric and Forge.
Any class registered as a plugin must implement the MoreMcmetaMetadataParserPlugin interface or the
MoreMcmetaTexturePlugin interface. Both of these plugin interfaces inherit from the ClientPlugin interface, which
defines methods that all client-side plugins must implement.
The ClientPlugin interface defines an id() method that returns the plugin's ID.
MoreMcmeta plugin IDs must be unique and must match the regular expression [a-z0-9_.-]+. This means IDs can only
contain the characters a-z (lowercase only), 0-9, _, ., and -; IDs must be at least one character in
length.
No two plugins may have the same ID, even if they are different types of plugins. For example, a
MoreMcmetaMetadataParserPlugin cannot have the same ID as a MoreMcmetaTexturePlugin.
Besides id(), the other methods a plugin must implement depend on the plugin's type.
MoreMcmeta uses Fabric's entrypoint mechanism to register plugins. In fabric.mod.json, add your plugin class as a
moremcmeta-client entrypoint. You can register more plugins by adding more classes to the array of entrypoints. For
example:
{
"entrypoints": {
"moremcmeta-client": [
"io.github.moremcmeta.emissiveplugin.fabric.OverlayPluginFabric"
]
}
}On Forge, the plugin class should be annotated with @MoreMcmetaClientPlugin. You can annotate multiple classes with
@MoreMcmetaClientPlugin to register multiple plugins within the same mod. For example:
@MoreMcmetaClientPlugin
public final class OverlayPluginForge implements MoreMcmetaTexturePlugin {
@Override
public String sectionName() {
return ModConstants.SECTION_NAME;
}
@Override
public MetadataAnalyzer analyzer() {
return ModConstants.ANALYZER;
}
@Override
public ComponentBuilder componentBuilder() {
return ModConstants.COMPONENT_BUILDER;
}
@Override
public String id() {
return ModConstants.MOD_ID;
}
}Please report errors or suggest improvements to this wiki using the documentation template on the issue tracker.
User Docs are written for regular Minecraft players and resource pack authors.
- User Docs: Animation Format
- User Docs: Emissive Format
- User Docs: Install Plugins
- User Docs: Troubleshooting
Plugin Docs are written for plugin developers.
- Plugin Docs: Overview
- Plugin Docs: Maven
- Plugin Docs: Plugin Registration
- Plugin Docs: Parser Plugins
- Plugin Docs: Texture Plugins
Dev Docs are written for MoreMcmeta developers.