LayoutEntity

data class LayoutEntity(val layoutId: String, val elements: Map<String, LayoutEntityElement> = mapOf(), val defaults: OptionEntity? = null)(source)

一个顶层布局及其元素、默认字体和图片组选项。 A top-level layout with its elements and default font/image options.

Parameters

layoutId

YAML 中的顶层布局 ID。 / Top-level layout ID in YAML.

elements

元素 ID 到配置的映射。 / Element IDs mapped to their configuration.

defaults

可选的布局默认资产配置。 / Optional default asset settings.

Constructors

Link copied to clipboard
constructor(layoutId: String, elements: Map<String, LayoutEntityElement> = mapOf(), defaults: OptionEntity? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

在资源包生成前登记图片字符与字体位置。 / Registers image glyphs and font positions before pack generation.

Link copied to clipboard
fun buildComponentString(player: Player, variables: Map<String, String> = mapOf(), applyAnchor: Boolean = true, renderContext: String = "default"): String?

同步构建布局原始字符串;无元素时返回 null。 Synchronously builds the raw layout string, returning null for an empty layout.

Link copied to clipboard
fun buildComponentStringAsync(player: Player, variables: Map<String, String> = mapOf(), applyAnchor: Boolean = true, resumeOnMain: Boolean = true, renderContext: String = "default", progressRefresh: Int? = null, strictTextScripts: Boolean = false): CompletableFuture<String?>

异步构建布局字符串,不阻塞调用线程等待脚本求值。 Builds the layout string asynchronously without waiting for scripts on the caller’s thread.

Link copied to clipboard
fun buildComponentText(player: Player, variables: Map<String, String> = mapOf(), applyAnchor: Boolean = true, renderContext: String = "default"): ComponentText?

同步构建已解析的布局文本组件。 / Synchronously builds a parsed layout component.

Link copied to clipboard
fun buildComponentTextAsync(player: Player, variables: Map<String, String> = mapOf(), renderContext: String = "default", progressRefresh: Int? = null): CompletableFuture<ComponentText?>

异步构建已解析的布局文本组件。 / Asynchronously builds a parsed layout component.