Package me.tamkungz.nilkit.helper
Class NilLoaderHelper
java.lang.Object
me.tamkungz.nilkit.helper.NilLoaderHelper
NilLoaderHelper — convenience wrapper around NilLoader mod metadata APIs.
This helper centralizes common mod-list and metadata operations that are
frequently used by SDK-based mods, so each mod does not need to re-implement
boilerplate logic around NilModList / NilMetadata.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanTrue when all required SDK metadata dependencies are currently loaded.static StringdescribeMod(String id) Returns a compact single-line description suitable for logs.static List<nilloader.api.NilMetadata> Returns all loaded mod metadata entries.getCredits(String id) Returns credits/contributors from SDK metadata.static StringgetEntrypointClass(String id, String phase) Returns a specific entrypoint target class for a given phase.Returns declared entrypoint names for the given mod id.getEntrypoints(String id) Returns all entrypoint phase->class mappings for the given mod id.static Optional<nilloader.api.NilMetadata> getFirstLoadedMod(String... candidateIds) Returns the first loaded mod from the provided candidate ids.static StringgetIconPath(String id) Returns icon path from SDK metadata, or null if not declared.static StringgetLicense(String id) Returns license string from SDK metadata, or null if not declared.getLoadAfter(String id) Returns ids this mod prefers to load after (advisory metadata).getLoadBefore(String id) Returns ids this mod prefers to load before (advisory metadata).Easy icon map for UI integrations (e.g., mod menu).Returns all loaded mod ids.Returns all loaded mod names.Returns a map of loaded mods by id, preserving load iteration order.Returns list of missing required mod ids declared in SDK metadata.Returns dependency report of loaded mods currently missing required dependencies.static Optional<nilloader.api.NilMetadata> getModMetadata(String id) Returns metadata for a mod id.static nilloader.api.NilMetadataSafe metadata lookup that returns null when unavailable.getModsRequiring(String requiredModId) Returns loaded mod ids that declare the given mod id as a required dependency.getModsWithEntrypoint(String phase) Returns loaded mod ids that have declared an entrypoint for the given phase.static StringReturns mod page URL from SDK metadata, or null if not declared.Returns required mod ids declared in SDK metadata.static Optional<SdkModMetadata> getSdkMetadata(String id) Reads SDK-only metadata for a loaded mod by id from `.nilsdkmod.kdl` (fallback: legacy `.kdl` names).static Optional<SdkModMetadata> getSdkMetadata(nilloader.api.NilMetadata mod) Reads SDK-only metadata from aNilMetadata.sourcelocation.static FilegetSourceFile(String id) Returns the source file (JAR/path) of the given mod id.static StringgetSourceUrl(String id) Returns source repository URL from SDK metadata, or null if not declared.static booleanhasEntrypoint(String id, String phase) Returns true if a mod declares an entrypoint for a given phase.static booleanReturns true if this mod is currently missing any required dependencies.static booleanisAllModsLoaded(String... ids) Returns true if all provided mod ids are loaded.static booleanisAnyModLoaded(String... ids) Returns true if at least one provided mod id is loaded.static booleanisModLoaded(String id) Returns true if a mod with the given id is loaded.static booleanisSafeLoad(String id) Whether this mod should soft-fail on missing dependencies (default true).
-
Method Details
-
isModLoaded
Returns true if a mod with the given id is loaded. -
isAnyModLoaded
Returns true if at least one provided mod id is loaded. -
isAllModsLoaded
Returns true if all provided mod ids are loaded. -
getModMetadata
Returns metadata for a mod id. -
getModMetadataOrNull
Safe metadata lookup that returns null when unavailable. -
getFirstLoadedMod
Returns the first loaded mod from the provided candidate ids. -
getAllLoadedMods
Returns all loaded mod metadata entries. -
getLoadedModIds
Returns all loaded mod ids. -
getLoadedModNames
Returns all loaded mod names. -
getLoadedModsById
Returns a map of loaded mods by id, preserving load iteration order. -
getSourceFile
Returns the source file (JAR/path) of the given mod id. -
getEntrypointNames
Returns declared entrypoint names for the given mod id. -
getEntrypointClass
Returns a specific entrypoint target class for a given phase. -
getEntrypoints
Returns all entrypoint phase->class mappings for the given mod id. -
hasEntrypoint
Returns true if a mod declares an entrypoint for a given phase. -
describeMod
Returns a compact single-line description suitable for logs. -
getSdkMetadata
Reads SDK-only metadata for a loaded mod by id from `.nilsdkmod.kdl` (fallback: legacy `.kdl` names).This is optional metadata and does not affect base NilLoader metadata parsing.
-
getSdkMetadata
Reads SDK-only metadata from aNilMetadata.sourcelocation. -
getMissingRequiredMods
Returns list of missing required mod ids declared in SDK metadata. -
hasMissingRequiredMods
Returns true if this mod is currently missing any required dependencies. -
areRequiredModsLoaded
True when all required SDK metadata dependencies are currently loaded. -
getLoadBefore
Returns ids this mod prefers to load before (advisory metadata). -
getLoadAfter
Returns ids this mod prefers to load after (advisory metadata). -
getIconPath
Returns icon path from SDK metadata, or null if not declared. -
getModUrl
Returns mod page URL from SDK metadata, or null if not declared. -
getSourceUrl
Returns source repository URL from SDK metadata, or null if not declared. -
getLicense
Returns license string from SDK metadata, or null if not declared. -
getCredits
Returns credits/contributors from SDK metadata. -
getRequiredMods
Returns required mod ids declared in SDK metadata. -
isSafeLoad
Whether this mod should soft-fail on missing dependencies (default true). -
getLoadedModIcons
Easy icon map for UI integrations (e.g., mod menu). -
getModsWithEntrypoint
Returns loaded mod ids that have declared an entrypoint for the given phase. -
getMissingRequiredModsForLoadedMods
Returns dependency report of loaded mods currently missing required dependencies.Map key is loaded mod id, map value is list of missing required ids.
-
getModsRequiring
Returns loaded mod ids that declare the given mod id as a required dependency.
-