ScopedBlockStateProperty

abstract class ScopedBlockStateProperty<T : Any>(val property: BlockStateProperty<T>, val values: Set<T>, val initializer: BlockStatePropertyInitializer<T>)

Represents a property-type of a block state, along with the allowed values.

Constructors

Link copied to clipboard
constructor(property: BlockStateProperty<T>, values: Set<T>, initializer: BlockStatePropertyInitializer<T>)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val values: Set<T>

Functions

Link copied to clipboard
abstract fun idToValue(id: Int): T?

Converts the given id to its corresponding value of type T or throws an IllegalArgumentException if id is not valid for this property.

Link copied to clipboard
open fun isValidId(id: Int): Boolean

Determines whether the given id is valid for this property.

Link copied to clipboard
abstract fun isValidString(string: String): Boolean

Determines whether the given string is valid for this property.

Link copied to clipboard
open fun isValidValue(value: T): Boolean

Determines whether the given value is valid for this property.

Link copied to clipboard
abstract fun stringToValue(string: String): T

Converts the given string to the corresponding value or throws an IllegalArgumentException if string is not valid for this property.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
abstract fun valueToId(value: T): Int

Converts the given value to its corresponding id or throws an IllegalArgumentException if value is not valid for this property.

Link copied to clipboard
abstract fun valueToString(value: T): String

Converts the given value to a String or throws an IllegalArgumentException if value is not valid for this property.