Interface ModContext


public interface ModContext
What ZomboidForge provides to one mod. Mods reach it through the methods of Mod; ZomboidForge implements it.
  • Method Summary

    Modifier and Type
    Method
    Description
    Virtual threads for blocking work such as HTTP calls or file I/O.
    The mod's settings from config.toml.
    The mod's folder, <forge>/mods/<id>.
    Event listener registration.
    The running Project Zomboid version.
    id()
    The mod's id from mod.toml.
    Logger whose messages go into the Project Zomboid log, marked with the mod's id.
    The server's main thread, for everything that touches game objects.
    The mod's own platform thread, zf-mod-<id>: one task at a time, in order.
    The mod's tables in the world's zomboidforge.db.
    The mod's version from mod.toml.
  • Method Details

    • id

      String id()
      The mod's id from mod.toml.
    • version

      String version()
      The mod's version from mod.toml.
    • gameVersion

      GameVersion gameVersion()
      The running Project Zomboid version.
    • logger

      System.Logger logger()
      Logger whose messages go into the Project Zomboid log, marked with the mod's id.
    • directory

      Path directory()
      The mod's folder, <forge>/mods/<id>.
    • config

      ModConfig config()
      The mod's settings from config.toml.
    • events

      Events events()
      Event listener registration.
    • main

      MainThread main()
      The server's main thread, for everything that touches game objects.
    • modThread

      ModThread modThread()
      The mod's own platform thread, zf-mod-<id>: one task at a time, in order.
    • async

      AsyncExecutor async()
      Virtual threads for blocking work such as HTTP calls or file I/O.
    • storage

      ModStorage storage()
      The mod's tables in the world's zomboidforge.db.