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 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()
      true on the physical/logical client.
    • configDir

      Path configDir()
      Directory where per-mod config files live (the loader's config folder).
    • isModLoaded

      boolean isModLoaded(String modId)
      Whether another mod is present. Never throws.
    • getModVersion

      String getModVersion(String modId)
      Version of another mod, or null when absent/unknown. Never throws.
    • loadedMods

      default List<LoadedMod> loadedMods()
      Every mod the loader has loaded. Empty when unknown. Never throws.
    • gameDir

      default Path gameDir()
      The game (client) or server directory that holds config, logs and mods.