Skip to content
On this page
通用

KattonBlockApi

common/src/main/kotlin/top/katton/api/dpcaller/KattonBlockApi.kt
Map-like access to blocks in a level by position.

KattonLevelBlockCollection

KattonLevelBlockCollection通用
kotlin
class KattonLevelBlockCollection( val level: Level )

Map-like access to blocks in a level by position.

以类似 Map 的方式按位置访问关卡中的方块。

属性

属性说明
levelThe Level containing the blocks

KattonLevelBlockCollection.get

KattonLevelBlockCollection.get通用函数
kotlin
operator fun get(blockPos: BlockPos): Block

获取方块 at a 位置。

KattonLevelBlockCollection.set

KattonLevelBlockCollection.set通用函数
kotlin
operator fun set(blockPos: BlockPos, block: Block)

使用默认状态在指定位置设置方块。

KattonLevelBlockCollection.set

KattonLevelBlockCollection.set通用函数
kotlin
operator fun set(start: BlockPos, end: BlockPos, block: Block)

使用方块的默认状态填充一个区域。

KattonLevelBlockStateCollection

KattonLevelBlockStateCollection通用
kotlin
class KattonLevelBlockStateCollection( val level: Level )

以类似 Map 的方式按位置访问关卡中的方块状态。

属性

属性说明
level包含这些方块的 Level。

KattonLevelBlockStateCollection.get

KattonLevelBlockStateCollection.get通用函数
kotlin
operator fun get(blockPos: BlockPos): BlockState

获取方块State at a 位置。

KattonLevelBlockStateCollection.set

KattonLevelBlockStateCollection.set通用函数
kotlin
operator fun set(blockPos: BlockPos, blockState: BlockState)

设置a 方块State at a 位置。

KattonLevelBlockStateCollection.set

KattonLevelBlockStateCollection.set通用函数
kotlin
operator fun set(start: BlockPos, end: BlockPos, blockState: BlockState)

使用方块状态填充一个区域。