···1212 set(value) { (this as RegistryManagerImpl).eventBus = value }
13131414@Mod("kritter")
1515-public object KritterForge1515+public class KritterForge
···7272public interface BlockEntityBlock<out BE : BlockEntity> : EntityBlock {
73737474 /**
7575- * This block's block entity type
7575+ * The block's block entity's class
7676 */
7777- public val blockEntityType: BlockEntityType<out BE>
7777+ public val blockEntityClass: KClass<out BE>
78787979 /**
8080- * The block's block entity's class
8080+ * This block's block entity type
8181+ * Is a method to guarantee this is not accessed during instantation of the block
8182 */
8282- public val blockEntityClass: KClass<out BE>
8383+ public fun getBlockEntityType(): BlockEntityType<out BE>
83848485 /**
8586 * Extension function to get a block entity with the specidic type
8687 */
8788 @Suppress("UNCHECKED_CAST")
8889 public fun Level.getBlockEntityOfType(pos: BlockPos): BE? = getBlockEntity(pos)?.let {
8989- if(blockEntityClass.isInstance(it) && it.type === blockEntityType) it as BE else null
9090+ if(blockEntityClass.isInstance(it) && it.type === getBlockEntityType()) it as BE else null
9091 }
91929293 override fun <T : BlockEntity> getListener(level: ServerLevel, blockEntity: T): GameEventListener?
···102103 } else null
103104104105105105- override fun newBlockEntity(pos: BlockPos, state: BlockState): BlockEntity? = blockEntityType.create(pos, state)
106106+ override fun newBlockEntity(pos: BlockPos, state: BlockState): BlockEntity? = getBlockEntityType().create(pos, state)
106107}
107108108109public interface TickableBlockEntity {