Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ModManager

The mod manager allows to load, unload and interact with Mods.

example

You can block loading your Mod if an incompatible mod is detected:

class MyMod extends GDAPI.Mod {
  constructor() {
    if(GDAPI.ModManager.has("my/incompatible/mod/uid"))
      GDAPI.ModManager.unload("my/mod/uid");
  }
}
example

You can interact with another mod using its public methods:

class MyMod extends GDAPI.Mod {
  constructor() {
    if(GDAPI.ModManager.has("my/compatible/mod/uid"))
      GDAPI.ModManager.get("my/compatible/mod/uid").setupIntegration(this);
  }
}

Hierarchy

  • ModManager

Index

Constructors

Methods

Constructors

constructor

Methods

Static add

  • add(uid: string, mod: Mod): void
  • Adds a mod to the manager.

    Parameters

    • uid: string

      The mods UID.

    • mod: Mod

      The mod instance to add.

    Returns void

Static get

  • get(modUID: string): null | Mod

Static getAllMods

  • getAllMods(): Mod[]

Static has

  • has(modUID: string): boolean
  • Check if a mod is loaded by uid.

    Parameters

    • modUID: string

      The mods UID.

    Returns boolean

Static unload

  • unload(modUID: string): void
  • Unloads a mod by uid.

    Parameters

    • modUID: string

      The mods UID.

    Returns void