Skip to content
On this page
通用

BlockEntityType

top.katton.api.registrycommon/src/main/kotlin/top/katton/api/registry/BlockEntityType.kt
注册原生 BlockEntityType,并支持热重载。

registerNativeBlockEntityType

registerNativeBlockEntityType通用函数
kotlin
fun registerNativeBlockEntityType(id: String, registerMode: RegisterMode = RegisterMode.WORLD, blockEntityTypeFactory: () -> BlockEntityType<*>): KattonRegistry.KattonBlockEntityTypeEntry

注册原生 BlockEntityType,并支持热重载。

参数

参数说明
idBlockEntityType 标识符,例如 "mymod:custom_block_entity"。
registerMode注册模式(GLOBAL、WORLD 或 RELOADABLE)。
blockEntityTypeFactory创建 BlockEntityType 实例的工厂函数。

返回值

已注册的 KattonBlockEntityTypeEntry。

registerNativeBlockEntityType

registerNativeBlockEntityType通用函数
kotlin
fun registerNativeBlockEntityType(id: Identifier, registerMode: RegisterMode = RegisterMode.WORLD, blockEntityTypeFactory: () -> BlockEntityType<*>): KattonRegistry.KattonBlockEntityTypeEntry

注册原生 BlockEntityType,并支持热重载。

参数

参数说明
idBlockEntityType 标识符。
registerMode注册模式。
blockEntityTypeFactory创建 BlockEntityType 实例的工厂函数。

返回值

已注册的 KattonBlockEntityTypeEntry。