LiLaC API

Documentation of the public LiLaC API.

Adding dependency

LiLaC doesn't have a maven repository. You can install it from Modrinth Maven or Curse Maven.

LiLaC API is shipped as a separate JAR file from the LiLaC implementation, which can be embedded inside other JARs. Use one of modCompileOnly, modCompileOnlyApi, modImplementation configurations in gradle to add a dependency on LiLaC API JAR. The API JAR is not the main file.

To load the LiLaC implementation at runtime, add the main LiLaC JAR to the modLocalRuntime or modRuntimeOnly configuration. I have no idea what the difference is, maybe ask it in the Fabric discord. I use modLocalRuntime.

Which configuration

Disclaimer: I'm not a Gradle expert.

ConfigurationWhen to useLiLaC API available at
modCompileOnlyWhen you only use those parts of LiLaC API, which are only called by LiLaC (for example, the resource loader API)Compile time
modCompileOnlyApiSame as modCompileOnly, but use this, if your code exposes part of LiLaC APICompile time
modImplementationWhen you directly use LiLaC API annotated with @RequiresImplementationCompile time and runtime

fabric.mod.json

If you use LiLaC API, you should add it to one of the dependencies blocks. LiLaC API provides lilac-api, and LiLaC (implementation) provides lilac and lilac-api.

Some guidelines what to put in which dependency block

ScenarioWhat to put in which dependency blockWhat to embed
You use LiLaC API unconditionally (required dependency)Put lilac in dependsNothing
You use LiLaC API conditionally (optional dependency)Put lilac-api in dependsLiLaC API JAR
You only use those parts of LiLaC API, which are only called by LiLaCPut lilac-api in recommends or suggestsNothing

If you want LiLaC to call your API, then go to you probably want LiLaC as a required dependency.

It is recommended to add a dependency on the minor version of LiLaC (API) to avoid crashes caused by breaking changes in LiLaC. This way, Fabric will refuse to load likely incompatible mods.

For example, "lilac": "~1.0.0-beta.2" means >=1.0.0-beta.2 <1.1.0

Embedding LiLaC

You may embed LiLaC API to prevent crashes caused by missing classes.

You can find some guidelines in the previous table.

Avoid embedding LiLaC (implementation).

Packages

Link copied to clipboard

Contains every LiLaC annotation available for public consumption.

Link copied to clipboard

Contains the core LiLaC API class.

Link copied to clipboard

Contains a DFU codec for VersionPredicate.

Link copied to clipboard

Contains utilities related to deserializing custom metadata from fabric.mod.json.

Link copied to clipboard

Wrapper code around Minecraft registry providing lookup functionality across multiple Minecraft versions.

Link copied to clipboard

Wrapper interfaces around Minecraft resources and resource packs.

Link copied to clipboard

LiLaC resource loading API.

Link copied to clipboard

Externally trigger-able game tick handling event.

Link copied to clipboard

Exceptions thrown by LiLaC.

Link copied to clipboard

Various utility functions, which are not necessarily related to Fabric or Minecraft.