TileEntityLimited

Tracks tile-entity placement and removal and enforces tile-entity limits. Should only be applied to tile-entity blocks.

Functions

Link copied to clipboard
open suspend override 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
open 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. Handlers should check BlockBreak.BLOCK_DROPS and BlockBreak.BLOCK_STORAGE_DROPS.

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

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

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

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
open 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
open 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

Whether this behavior implements random-tick logic for the given state. Note that the result of this method will be cached on startup.

Link copied to clipboard
open 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.