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 TypeMethodDescriptionasync()Virtual threads for blocking work such as HTTP calls or file I/O.Server commands to clients, received by their Lua mods.commands()Admin command registration.config()The mod's settings fromconfig.toml.The mod's folder,<forge>/mods/<id>.events()Event listener registration.The running Project Zomboid version.id()The mod's id frommod.toml.logger()Logger whose messages go into the Project Zomboid log, marked with the mod's id.main()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.storage()The mod's tables in the world'szomboidforge.db.version()The mod's version frommod.toml.
-
Method Details
-
id
String id()The mod's id frommod.toml. -
version
String version()The mod's version frommod.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 fromconfig.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'szomboidforge.db. -
commands
Commands commands()Admin command registration. -
clientCommands
ClientCommands clientCommands()Server commands to clients, received by their Lua mods.
-