PaperUi

object PaperUi(source)

Application API supplied by the installed Strata Paper plugin. Depend on Strata and compile against this API without bundling it. Player operations require Paper's primary thread or the player's Folia region. On Folia, create state inside open and enter execute for subsequent state or session access.

Functions

Link copied to clipboard
fun capabilities(player: Player): UiClientCapabilities?

Returns the current successful client negotiation, or null before readiness or after disconnection.

Link copied to clipboard
fun <T> execute(player: Player, operation: () -> T): T

Enters the player's UI execution owner for state and session access without changing the native region. Async callers must first schedule on the player; this method never grants access to another entity's region.

Link copied to clipboard

Installs one runtime; closing the registration releases only that installation.

Link copied to clipboard
fun open(ownerPlugin: Plugin, player: Player, definition: () -> UiDefinition): UiSession

Creates state and a fresh definition inside the player's execution owner, synchronously on the calling region. Mutable state must be created inside this factory and outside the definition's reevaluated content.

Link copied to clipboard
fun register(ownerPlugin: Plugin, type: ProjectionType)

Registers a plugin-owned extension for future client negotiations.