Skip to content

Plugin Docs: Overview

soir20 edited this page Jun 24, 2023 · 4 revisions

Welcome to the MoreMcmeta documentation for plugin developers.

As of version 4.0.0, MoreMcmeta provides a texture configuration API. The API is based on metadata files that configure various effects for almost any texture, rather than hard-coding effects for certain textures. Metadata file parsing and texturing effects are implemented as plugins.

Since MoreMcmeta is a client-side mod, the API is also client-side. The API is available on both Forge and Fabric on any Minecraft version MoreMcmeta actively supports. Plugin developers have the option of supporting what launcher(s) they want and what Minecraft version(s) they want, as long as MoreMcmeta supports those launchers and versions.

Overview of MoreMcmeta Client-Side Plugins

MoreMcmeta divides texture configuration into three phases: metadata parsing, metadata analysis, and component building.

Metadata parsing reads metadata files in various formats, such as .properties and .moremcmeta. Every metadata file is parsed into a MetadataView, an immutable, format-independent representation of the metadata. When multiple metadata files of the same format are associated with the same texture, they are combined into a single MetadataView. (Multiple metadata files of different formats are not allowed to apply to the same texture.)

Metadata analysis takes the MetadataView for each texture from the parsing stage as an input and produces one AnalyzedMetadata per plugin. AnalyzedMetadata contains plugin-specific data. It might also define parameters, like the frame size or blur/clamp settings, that MoreMcmeta handles internally.

Component building takes each plugin's AnalyzedMetadata and uses that plugin's ComponentBuilder to build a TextureComponent. A TextureComponent implements texturing effects in response to various events (onTick(), onClose()). A ComponentBuilder can also modify each frame during building if the texturing effect never updates.

These phases are analogous to the way programming languages are implemented. Programming language parsers convert human-readable code into an abstract syntax tree (AST). The AST is then analyzed and/or executed by an interpreter or compiler. MoreMcmeta's MetadataView is similar to an AST, and the MetadataAnalyzer and ComponentBuilder act like a "compiler." A TextureComponent is similar to an outputted executable.

Parser Plugins

Parser plugins implement the metadata parsing phase for a particular metadata file extension. They implement the MoreMcmetaMetadataParserPlugin interface. See the parser plugin documentation for more details.

Texture Plugins

Texture plugins implement the metadata analysis and component building phases. They implement the MoreMcmetaTexturePlugin interface. See the texture plugin documentation for more details.

Java Packages

MoreMcmeta provides the moremcmeta.api Java package and its loader-specific counterparts for you to use. Do not use code from impl packages. MoreMcmeta will take care to avoid breaking changes to the API and use semantic versioning to indicate the scope of changes. impl code is internal and will change without warning and without regard to how plugins use it. If there is something missing from the API, please create a feature request.

Develop Your Own Plugin

Read more plugin development documentation to create your own plugin:

Plugin Examples

MoreMcmeta provides a plugin template that contains an example Gradle configuration. MoreMcmeta's default plugins also serve as examples of complete implementations:

Clone this wiki locally