FluidState

A state of a fluid.

Functions

Link copied to clipboard
abstract fun asBlock(): BlockState

Converts this fluid state in to its corresponding block state.

Link copied to clipboard
abstract fun <T : Comparable<T>> getProperty(property: Property<T>): T?

Gets the value for the given property, or returns null if there is no value for the given property.

Link copied to clipboard
abstract fun hasProperty(property: Property<*>): Boolean

Checks if the given property has a value on this state.

Link copied to clipboard
open fun isEmpty(): Boolean

If this fluid state is empty.

Link copied to clipboard
abstract fun isSource(): Boolean

If this fluid state is a source fluid.

Link copied to clipboard
abstract fun <T : Comparable<T>> requireProperty(property: Property<T>): T

Gets the value for the given property, or throws an IllegalArgumentException if there is no value for the given property.

Link copied to clipboard
abstract fun <T : Comparable<T>> setProperty(property: Property<T>, value: T): FluidState

Sets the value for the given property to the given value and returns the resulting state.

Properties

Link copied to clipboard
@get:JvmName(name = "availableProperties")
abstract val availableProperties: @Unmodifiable Set<Property<*>>

All of the properties that can be set on this state.

Link copied to clipboard
@get:JvmName(name = "fluid")
abstract val fluid: Fluid

The fluid this is a state of.

Link copied to clipboard
@get:JvmName(name = "level")
abstract val level: Int

The level of this fluid state.

Link copied to clipboard
@get:JvmName(name = "properties")
abstract val properties: @Unmodifiable Map<Property<*>, Comparable<*>>

All of the properties that are currently set on this state.