Class LibraryJson
java.lang.Object
com.cleanroommc.gradle.api.util.dist.LibraryJson
Turns resolved artifacts into the library entries launchers understand.
The MMC pack and the installer profile are two dialects of the same JSON. MMC writes the overlay on top of Minecraft 1.12.2, whereas the installer list is self-contained.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Artifactartifact(Coordinate coordinate, Path path, String url) static StringartifactUrl(Coordinate coordinate, Map<String, String> repositories) Longest matching group prefix wins with*being the fallback.static com.google.gson.JsonObjectstatic com.google.gson.JsonObjectembeddedLibrary(Artifact artifact) A library entry whose file the installer embeds rather than downloads.static booleanAn artifact with no download url is one whose file travels inside the archive.static booleanisNative(Coordinate coordinate) static com.google.gson.JsonObjectlocalLibrary(Artifact artifact) A library both MultiMC and Prism take from the instance's ownlibraries/folder instead of downloading.static com.google.gson.JsonArraymmcLibraries(List<Artifact> artifacts) The MultiMC/Prism dialect: Natives are folded into their base module underclassifierswith anativesplatform map.static com.google.gson.JsonArraymojangLibraries(List<Artifact> artifacts) The Mojang dialect used byversion.jsonfor classpath libraries: One flat entry per artifact, classifiers in the name, including LWJGL 3 native jars.static com.google.gson.JsonArraymojangNativeLibraries(List<Artifact> artifacts) The Mojang dialect for natives: One entry per module, its classifiers under anativesplatform map, extracted rather than classpathed.static com.google.gson.JsonObjectnativeLibrary(Coordinate base, List<Artifact> artifacts) static StringnativePlatform(String classifier) static com.google.gson.JsonObjectordinaryLibrary(Artifact artifact) resolve(Artifact universal, List<? extends LibraryArtifact> libraries, Map<String, String> repositories) Resolves the library inputs into a deterministic, deduplicated artifact list.resolve(Artifact universal, List<? extends LibraryArtifact> libraries, Set<String> inherited, Map<String, String> repositories) static StringtrailingSlash(String value)
-
Method Details
-
resolve
public static List<Artifact> resolve(Artifact universal, List<? extends LibraryArtifact> libraries, Map<String, String> repositories) Resolves the library inputs into a deterministic, deduplicated artifact list.- Parameters:
universal- the loader's own jar, always listed firstrepositories- group prefix to base URL, with*as the fallback
-
resolve
-
mmcLibraries
-
mojangLibraries
-
mojangNativeLibraries
-
embeddedLibrary
A library entry whose file the installer embeds rather than downloads. -
ordinaryLibrary
-
localLibrary
A library both MultiMC and Prism take from the instance's ownlibraries/folder instead of downloading. The launcher matches it by bare file name, and never issues a download for it, so the entry carries no url. -
isLocal
An artifact with no download url is one whose file travels inside the archive. -
nativeLibrary
-
download
- Parameters:
withPath- whether to include thepathkey, which Mojang's format carries but not MMC's format
-
artifact
-
artifactUrl
Longest matching group prefix wins with*being the fallback. -
nativePlatform
-
isNative
-
trailingSlash
-