|
Quilt Loader 1
|
Classes | |
| enum | BasicSourceType |
Public Member Functions | |
| ModMetadata | metadata () |
| Path | rootPath () |
| Returns the root directory of the mod (inside JAR/folder), exposing its contents. | |
| default Path | getPath (String file) |
| Gets an NIO reference to a file inside the JAR. | |
| List< List< Path > > | getSourcePaths () |
| Gets where the mod was loaded from. | |
| BasicSourceType | getSourceType () |
| Gets the "basic source type" of this mod, which represents where it comes from. | |
| ClassLoader | getClassLoader () |
Retrieves the ClassLoader which directly stores classes for this mod. | |
| ClassLoader org.quiltmc.loader.api.ModContainer.getClassLoader | ( | ) |
Retrieves the ClassLoader which directly stores classes for this mod.
Most mods will have no use for this method, since classes from any mod can be loaded by using the ClassLoader that loaded that mods class (so using Class.forName("pkg.ClassName") will work for any mod).
This returns null for BasicSourceType#BUILTIN mods, and potentially BasicSourceType#OTHER.
ClassLoader which loads classes for this mod, or null if quilt-loader doesn't provide that ClassLoader. Implemented in org.quiltmc.loader.api.plugin.ModContainerExt.
|
inline |
Gets an NIO reference to a file inside the JAR.
The path is not guaranteed to exist!
A path returned by this method may be incompatible with Path#toFile as its FileSystem doesn't necessarily represent the OS file system, but potentially a virtual view of jar contents or another abstraction.
Files contains methods that operate on Paths, instead of File.
| file | The location from root, using / as a separator. |
| List< List< Path > > org.quiltmc.loader.api.ModContainer.getSourcePaths | ( | ) |
Gets where the mod was loaded from.
Each sub-list is a full path from the root of the filesystem, up through any jar-in-jars that the mod may be contained by.
This location is not necessarily identical to the code source used at runtime, a mod may get copied or otherwise transformed before being put on the class path. It thus mostly represents the installation and initial loading, not what is being directly accessed at runtime.
The mod origin is provided for working with the installation like telling the user where a mod has been installed at. Accessing the files inside a mod jar/folder should use getPath and rootPath instead. Those also abstract jar accesses through the virtual ZipFileSystem away.
Implemented in org.quiltmc.loader.impl.metadata.qmj.ProvidedModContainer, and org.quiltmc.loader.impl.plugin.base.InternalModContainerBase.
| BasicSourceType org.quiltmc.loader.api.ModContainer.getSourceType | ( | ) |
Gets the "basic source type" of this mod, which represents where it comes from.
Some plugins may provide more information on where their mods came from - although you'll need to reference those plugins for obtaining that information. (It might be exposed in a getter method in one of the plugins classes, or it could be an extension interface of this class).
Implemented in org.quiltmc.loader.impl.metadata.qmj.ProvidedModContainer, org.quiltmc.loader.impl.plugin.fabric.FabricModContainer, org.quiltmc.loader.impl.plugin.quilt.BuiltinModContainer, and org.quiltmc.loader.impl.plugin.quilt.QuiltModContainer.
| Path org.quiltmc.loader.api.ModContainer.rootPath | ( | ) |
Returns the root directory of the mod (inside JAR/folder), exposing its contents.
A path returned by this method may be incompatible with Path#toFile as its FileSystem doesn't necessarily represent the OS file system, but potentially a virtual view of jar contents or another abstraction.
Files contains methods that operate on Paths, instead of File.
Implemented in org.quiltmc.loader.impl.metadata.qmj.ProvidedModContainer, and org.quiltmc.loader.impl.plugin.base.InternalModContainerBase.