|
Quilt Loader 1
|
Represents a mod. More...
Public Member Functions | |
| ModMetadata | getMetadata () |
| Returns the metadata of this mod. | |
| List< Path > | getRootPaths () |
| Returns the root directories of the mod (inside JAR/folder), exposing its contents. | |
| default Optional< Path > | findPath (String file) |
| Gets an NIO reference to a file inside the JAR/folder. | |
| ModOrigin | getOrigin () |
| Gets where the mod was loaded from originally, the mod jar/folder itself. | |
| Optional< ModContainer > | getContainingMod () |
| Get the mod containing this mod (nested jar parent). | |
| Collection< ModContainer > | getContainedMods () |
| Get the active mods contained within this mod (nested jar children). | |
| default Path | getRoot () |
| Path | getRootPath () |
| Path | getPath (String file) |
Represents a mod.
|
inline |
Gets an NIO reference to a file inside the JAR/folder.
The path, if present, is 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.
| file | The location from a root path, using / as a separator. |
| Collection< ModContainer > net.fabricmc.loader.api.ModContainer.getContainedMods | ( | ) |
Get the active mods contained within this mod (nested jar children).
Implemented in net.fabricmc.loader.impl.ModContainerImpl.
| Optional< ModContainer > net.fabricmc.loader.api.ModContainer.getContainingMod | ( | ) |
Get the mod containing this mod (nested jar parent).
Implemented in net.fabricmc.loader.impl.ModContainerImpl.
| ModMetadata net.fabricmc.loader.api.ModContainer.getMetadata | ( | ) |
Returns the metadata of this mod.
Implemented in net.fabricmc.loader.impl.ModContainerImpl.
| ModOrigin net.fabricmc.loader.api.ModContainer.getOrigin | ( | ) |
Gets where the mod was loaded from originally, the mod jar/folder itself.
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 findPath and getRootPaths instead. Those also abstract jar accesses through the virtual ZipFileSystem away.
Implemented in net.fabricmc.loader.impl.ModContainerImpl.
| List< Path > net.fabricmc.loader.api.ModContainer.getRootPaths | ( | ) |
Returns the root directories of the mod (inside JAR/folder), exposing its contents.
The paths may point to regular folders or into mod JARs. Multiple root paths may occur in development environments with -Dfabric.classPathGroups as used in multi-project mod setups.
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.
Implemented in net.fabricmc.loader.impl.ModContainerImpl.