DataWrapper

data class DataWrapper<P : Any, C : Any>(val dataType: PersistentDataType<P, C>, val value: C)

A wrapper class to encapsulate a value and its associated PersistentDataType. This class provides utility methods for interacting with PersistentDataContainers.

Since

1.1.1

Parameters

P

The primitive type of the PersistentDataType.

C

The complex type of the PersistentDataType.

Constructors

Link copied to clipboard
constructor(dataType: PersistentDataType<P, C>, value: C)

Types

Link copied to clipboard
object Companion

Companion object providing utility functions for managing persistent data storage and retrieval within a data container.

Properties

Link copied to clipboard
val dataType: PersistentDataType<P, C>

The PersistentDataType used to interact with the container.

Link copied to clipboard
val value: C

The value to be stored or retrieved from the container.

Functions

Link copied to clipboard
fun setTo(container: PersistentDataContainer, key: NamespacedKey)

Sets a value into the provided PersistentDataContainer using a specified key.