Interface PlatformService
public interface PlatformService
Loader-specific behaviour behind a tiny interface.
Common code must never import Fabric/Forge/NeoForge APIs directly.
Each loader module provides exactly one implementation, discovered via
ServiceLoader. Implementations live in the loader
modules (e.g. my.celium.org.fabric.FabricPlatformService).
-
Method Summary
Modifier and TypeMethodDescriptionDirectory where per-mod config files live (the loader'sconfigfolder).default PathgameDir()The game (client) or server directory that holdsconfig,logsandmods.getModVersion(String modId) Version of another mod, ornullwhen absent/unknown.booleanisClient()trueon the physical/logical client.booleanisModLoaded(String modId) Whether another mod is present.Every mod the loader has loaded.Loader version string, e.g.Minecraft version string, e.g.platform()Which loader this implementation is for.
-
Method Details
-
platform
Platform platform()Which loader this implementation is for. -
loaderVersion
String loaderVersion()Loader version string, e.g. Fabric Loader"0.19.5". -
minecraftVersion
String minecraftVersion()Minecraft version string, e.g."26.3". -
isClient
boolean isClient()trueon the physical/logical client. -
configDir
Path configDir()Directory where per-mod config files live (the loader'sconfigfolder). -
isModLoaded
Whether another mod is present. Never throws. -
getModVersion
-
loadedMods
-
gameDir
The game (client) or server directory that holdsconfig,logsandmods.
-