The public-facing QuiltLoader instance.
More...
The public-facing QuiltLoader instance.
◆ createModTable()
| String org.quiltmc.loader.api.QuiltLoader.createModTable |
( |
| ) |
|
|
inlinestatic |
Creates a table describing the mods currently loaded, suitable for printing in log files or in crash reports.
All of the information contained here is available through getAllMods().
◆ getAllMods()
| Collection< ModContainer > org.quiltmc.loader.api.QuiltLoader.getAllMods |
( |
| ) |
|
|
inlinestatic |
Gets all mod containers.
- Returns
- a collection of all loaded mod containers
◆ getCacheDir()
| Path org.quiltmc.loader.api.QuiltLoader.getCacheDir |
( |
| ) |
|
|
inlinestatic |
Get the current directory for temporary files.
- Returns
- the cache directory
◆ getConfigDir()
| Path org.quiltmc.loader.api.QuiltLoader.getConfigDir |
( |
| ) |
|
|
inlinestatic |
Get the current directory for game configuration files.
- Returns
- the configuration directory
◆ getEntrypointContainers()
Returns all entrypoints declared under a key, assuming they are of a specific type.
The entrypoint is declared in the fabric.mod.json as following:
"entrypoints": {
"<a key>": [
<a list of entrypoint declarations>
]
}
Multiple keys can be present in the entrypoints section.
An entrypoint declaration indicates that an arbitrary notation is sent to a LanguageAdapter to offer an instance of entrypoint. It is either a string, or an object. An object declaration is of this form:
{
"adapter": "<a custom adatper>"
"value": "<an arbitrary notation>"
}
A string declaration <an arbitrary notation> is equivalent to
{
"adapter": "default"
"value": "<an arbitrary notation>"
}
where the default adapter is the adapter offered by Fabric Loader.
- Parameters
-
| key | the key in entrypoint declaration in fabric.mod.json |
| type | the type of entrypoints |
| <T> | the type of entrypoints |
- Returns
- the entrypoint containers related to this key
- Exceptions
-
- See also
- LanguageAdapter
◆ getEntrypoints()
| static< T > List< T > org.quiltmc.loader.api.QuiltLoader.getEntrypoints |
( |
String | key, |
|
|
Class< T > | type ) throws EntrypointException |
|
inlinestatic |
Returns all entrypoints declared under a key, assuming they are of a specific type.
- Parameters
-
| key | the key in entrypoint declaration in fabric.mod.json |
| type | the type of entrypoints |
| <T> | the type of entrypoints |
- Returns
- the obtained entrypoints
- Exceptions
-
- See also
- #getEntrypointContainers(String, Class)
◆ getGameDir()
| Path org.quiltmc.loader.api.QuiltLoader.getGameDir |
( |
| ) |
|
|
inlinestatic |
Get the current game working directory.
- Returns
- the working directory
◆ getGameInstance()
| Object org.quiltmc.loader.api.QuiltLoader.getGameInstance |
( |
| ) |
|
|
inlinestatic |
Get the current game instance.
Can represent a game client or server object. As such, the exact return is dependent on the current environment type.
The game instance may not always be available depending on the game version and environment.
- Returns
- A client or server instance object
- Deprecated
- This method is experimental and it's use is discouraged.
◆ getLaunchArguments()
| String[] org.quiltmc.loader.api.QuiltLoader.getLaunchArguments |
( |
boolean | sanitize | ) |
|
|
inlinestatic |
Gets the command line arguments used to launch the game.
If this is printed for debugging, make sure sanitize is true.
- Parameters
-
| sanitize | Whether to remove sensitive information |
- Returns
- the launch arguments
◆ getMappingResolver()
Get the current mapping resolver.
When performing reflection, a mod should always query the mapping resolver for the remapped names of members than relying on other heuristics.
- Returns
- the current mapping resolver instance
- Since
- 0.4.1
◆ getModContainer() [1/2]
| Optional< ModContainer > org.quiltmc.loader.api.QuiltLoader.getModContainer |
( |
Class<?> | clazz | ) |
|
|
inlinestatic |
Gets the mod container that provides the given class.
This only works for classes loaded by the system classloader and quilt-loader itself.
◆ getModContainer() [2/2]
| Optional< ModContainer > org.quiltmc.loader.api.QuiltLoader.getModContainer |
( |
String | id | ) |
|
|
inlinestatic |
Gets the container for a given mod.
- Parameters
-
- Returns
- the mod container, if present
◆ getNormalizedGameVersion()
| String org.quiltmc.loader.api.QuiltLoader.getNormalizedGameVersion |
( |
| ) |
|
|
inlinestatic |
◆ getObjectShare()
| ObjectShare org.quiltmc.loader.api.QuiltLoader.getObjectShare |
( |
| ) |
|
|
inlinestatic |
Get the object share for inter-mod communication.
The share allows mods to exchange data without directly referencing each other. This makes simple interaction easier by eliminating any compile- or run-time dependencies if the shared value type is independent of the mod (only Java/game/Fabric types like collections, primitives, String, Consumer, Function, ...).
Active interaction is possible as well since the shared values can be arbitrary Java objects. For example exposing a Runnable or Function allows the "API" user to directly invoke some program logic.
It is required to prefix the share key with the mod id like mymod:someProperty. Mods should not modify entries by other mods. The share is thread safe.
- Returns
- the global object share instance
◆ getRawGameVersion()
| String org.quiltmc.loader.api.QuiltLoader.getRawGameVersion |
( |
| ) |
|
|
inlinestatic |
Gets the game version, unnormalised.
This generally won't be usefully comparable to other versions of the same game.
- Returns
- A string. This wont be empty or null.
- See also
- getNormalizedGameVersion()
◆ globalDirsEnabled()
| boolean org.quiltmc.loader.api.QuiltLoader.globalDirsEnabled |
( |
| ) |
|
|
inlinestatic |
- Returns
- true if the global config and cache dirs are actually global, or false if they are simply subfolders of the per-instance folders.
◆ isDevelopmentEnvironment()
| boolean org.quiltmc.loader.api.QuiltLoader.isDevelopmentEnvironment |
( |
| ) |
|
|
inlinestatic |
Checks if Fabric Loader is currently running in a "development" environment.
Can be used for enabling debug mode or additional checks.
This should not be used to make assumptions on certain features, such as mappings, but as a toggle for certain functionalities.
- Returns
- whether or not Loader is currently in a "development" environment
◆ isModLoaded()
| boolean org.quiltmc.loader.api.QuiltLoader.isModLoaded |
( |
String | id | ) |
|
|
inlinestatic |
Checks if a mod with a given ID is loaded.
- Parameters
-
| id | the ID of the mod, as defined in fabric.mod.json |
- Returns
- whether or not the mod is present in this Fabric Loader instance
The documentation for this class was generated from the following file:
- src/main/java/org/quiltmc/loader/api/QuiltLoader.java