NovaTileEntityBlock

Properties

Link copied to clipboard
Link copied to clipboard

A list of all possible NovaBLockStates of this NovaBlock

Link copied to clipboard
val config: Provider<CommentedConfigurationNode>

The configuration for this NovaBlock. May be an empty node if the config file does not exist.

Link copied to clipboard

The default block state of this NovaBlock.

Link copied to clipboard
val id: Key
Link copied to clipboard

The NovaItem associated with this NovaBlock.

Link copied to clipboard
val name: Component
Link copied to clipboard
Link copied to clipboard
val style: Style
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun canPlace(pos: BlockPos, state: NovaBlockState, ctx: Context<BlockPlace>): Boolean

Checks whether a block of state can be placed at pos using the given ctx.

Link copied to clipboard

Chooses the appropriate NovaBlockState for placement given the ctx.

Link copied to clipboard
inline fun <T : Any> getBehavior(): T

Gets the first BlockBehavior that is an instance of T, or throws an IllegalStateException if there is none.

fun <T : Any> getBehavior(type: Class<T>): T
fun <T : Any> getBehavior(type: KClass<T>): T

Gets the first BlockBehavior that is an instance of type, or throws an IllegalStateException if there is none.

Link copied to clipboard
inline fun <T : Any> getBehaviorOrNull(): T?

Gets the first BlockBehavior that is an instance of T, or null if there is none.

fun <T : Any> getBehaviorOrNull(type: Class<T>): T?
fun <T : Any> getBehaviorOrNull(type: KClass<T>): T?

Gets the first BlockBehavior that is an instance of type or a subclass, or null if there is none.

Link copied to clipboard
fun getDrops(pos: BlockPos, state: NovaBlockState, ctx: Context<BlockBreak>): List<ItemStack>

Retrieves the items that would be dropped when breaking a block of state at pos with the given ctx.

Link copied to clipboard

Retrieves the amount of experience that would be dropped when breaking a block of state at pos with the given ctx.

Link copied to clipboard

Handles attack (left-click) on a block of state at pos with the given ctx.

Link copied to clipboard
open override fun handleBreak(pos: BlockPos, state: NovaBlockState, ctx: Context<BlockBreak>)

Handles the destruction of a block of state at pos with the given ctx.

Link copied to clipboard
fun handleEntityInside(pos: BlockPos, state: NovaBlockState, entity: Entity)

Called when an entity is inside a block of state at pos.

Link copied to clipboard

Called when a redstone update happened that may affect this state at pos.

Link copied to clipboard
open override fun handlePlace(pos: BlockPos, state: NovaBlockState, ctx: Context<BlockPlace>)

Handles the placement of a block of state at pos with the given ctx.

Link copied to clipboard

Handles a random tick for a block of state at pos.

Link copied to clipboard

Handles a scheduled tick for a block of state at pos.

Link copied to clipboard
inline fun <T : Any> hasBehavior(): Boolean

Checks whether this NovaBlock has a BlockBehavior of the reified type T, or a subclass of it.

fun <T : Any> hasBehavior(type: Class<T>): Boolean
fun <T : Any> hasBehavior(type: KClass<T>): Boolean

Checks whether this NovaBlock has a BlockBehavior of the specified class type, or a subclass of it.

Link copied to clipboard
fun pickBlockCreative(pos: BlockPos, state: NovaBlockState, ctx: Context<BlockInteract>): ItemStack?

Chooses the ItemStack that should be given to the player when mid-clicking a block of state at pos with the given ctx in creative mode.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun updateShape(pos: BlockPos, state: NovaBlockState, neighborPos: BlockPos): NovaBlockState

Called when a block at neighborPos changed to update the NovaBlockState of this state at pos.

Link copied to clipboard

Uses the block of state at pos by itself, without using an item.

Link copied to clipboard

Uses an item on the block of state at pos.