FML loader APIs and their Sunrise routes
NeoForge's mod loader (FML) hands a mod its own files and paths: the list of mod files, a config's full path, the game directory, an update URL. Sunrise answers the same needs with different shapes on purpose. This page says which FML APIs have no counterpart of the same shape, what a Sunrise mod uses instead, and why, so a porter does not search the vocabulary for a name that will never exist.
From Sunrise's modding bookead8a1e
A row marked by design is not a gap. A row that links an issue is a real gap that is tracked, not by design.
ModListfile reads:getModFiles,getModFileById,forEachModFile,applyForEachModFile,applyForEachModFileAlphabetical- Sunrise route
LoadedModsfromRegistrationContext:::mods() ids(),iter()andget(id)over the loaded packages, each aPackageInfo(see Load phases and access)- Why it differs
- By design. A package is one mod, so there is one
PackageInfoper mod rather than a file with several mods in it. It carries the id, version, kind, side, namespaces, dependencies and the manifest's details (display name, description, authors, license, links, the icon's path inside the package, runtime and properties), and no path to the package on disk. Iteration is in dispatch order; there is no alphabetical variant, so sort the ids yourself.
- Sunrise route
ConfigFile.file, a name relative toconfig/(or to a world'sserverconfig/), andHost::for the calling mod's own files (see Config files and settings)config_ files() - Why it differs
- By design.
config_is bound to the calling mod and never lists another mod's files. A wasm mod has no file path at all: the game reads the file and hands over its text.files()
FMLLoader.getGameDirandFMLPaths.GAMEDIR- Sunrise route
Host::on native;instance_ dir() RegistrationContext::on both targets (see Load phases and access)instance_ dir() - Why it differs
- By design.
Host::is native only: a wasm mod has no file system to point at, and reads its own data and assets through reload listeners.instance_ dir() RegistrationContext::gives the path on both targets, but as data, not as permission to open it.instance_ dir()
- Sunrise route
- None in a mod. The mod browser compares the installed version with the newest one in Sunrise's registry (see Installing and using mods)
- Why it differs
- By design for registry mods: updates come from the registry, not from a URL a mod declares. A mod installed from outside the registry has no update check yet.
A mod that needs to know who else is loaded asks LoadedMods; one that needs a file reads it through the services above. If neither answers, file an issue naming the FML API and what the mod does with it.
Edit this page on GitHub · Spotted something wrong? Open an issue or ask on Discord.



