AlexandriaHook

abstract class AlexandriaHook<S : AlexandriaHook.Settings>(val manifest: AlexandriaHook.Manifest, log: KLogger, settingsFile: File, configOptions: ConfigurationOptions)

Base implementation for hooks which interface with the game environment. This provides mostly platform-independent hooks for loading, initialization, reloading and unloading, as well as default implementations of resource loading like locale files.

The hook mechanism is a highly opinionated system, mainly so that the experience of using Alexandria-based hooks is consistent across both platforms and plugins/mods.

A hook like this is intended to be contained inside an actual platform-specific hook, such as a Paper plugin or Fabric mod initializer. The platform hook will then expose certain properties of this Alexandria hook through public properties and methods.

Parameters

S

the type of settings object.

manifest

the metadata for this hook.

log

the logger used by this hook.

settingsFile

the file location from which to load the S.

configOptions

the serializer options used when deserializing resources.

Constructors

Link copied to clipboard
constructor(manifest: AlexandriaHook.Manifest, log: KLogger, settingsFile: File, configOptions: ConfigurationOptions)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Manifest(val id: String, val accentColor: TextColor, val langResources: List<String>)

Metadata for an AlexandriaHook.

Link copied to clipboard
data class Meta(val name: String, val version: String, val authors: List<String>)
Link copied to clipboard
interface Settings

Properties

Link copied to clipboard
lateinit var glossa: Glossa
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
lateinit var settings: S

Functions

Link copied to clipboard
fun asChat(comp: Component): @NotNull TextComponent
Link copied to clipboard
fun init()
Link copied to clipboard
fun reload()
Link copied to clipboard
fun yamlConfigLoader(): YamlConfigurationLoader.Builder