Common¶
object Common : ConfigSpec.Common
Types¶
General¶
object General : CategorySpec
Test¶
object Test : CategorySpec
Properties¶
categories¶
val categories: List<CategorySpec>
Top-level sections of this config.
configFolder¶
var configFolder: Path
filename¶
Path of the config file, relative to configFolder, without extension.
id¶
isLoaded¶
Whether load has run at least once, or (for a synced spec) a value has been received from the server.
mod¶
val mod: Mod
predicate¶
synchronized¶
open val synchronized: Boolean = false
title¶
open override val title: Component
type¶
val type: ConfigSpec.Type
Functions¶
init¶
open override fun init()
Registers all categories (and their subcategories) and, for a synchronized spec, registers this spec's NetworkChannel plus the player-join/quit listeners that push it to joining clients and reset isLoaded on disconnect.
load¶
fun load()
Reads the config file via fileSerializer, creating it with defaults if absent, marks isLoaded, and attaches/scans every DataSpec.configSpecList/DataSpec.configSpecMap field reachable from categories - deferred to here, rather than init, since configFolder isn't final until just before this runs (a Server spec only repoints it at the per-world folder right before calling load).
save¶
fun save()
Writes the current values of every field in categories to the config file via fileSerializer.