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 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) resolve(List<? extends LibraryArtifact> libraries, Set<String> inherited) Resolves a component's libraries without adding the Cleanroom universal artifact.static StringtrailingSlash(String value)
-
Method Details
-
resolve
-
resolve
-
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
-
nativePlatform
-
isNative
-
trailingSlash
-