public class TutorialBlockEntityTypes { public static > T register(String path, T blockEntityType) { return Registry.register(Registries.BLOCK_ENTITY_TYPE, Identifier.of("tutorial", path), blockEntityType); } public static final BlockEntityType DEMO_BLOCK = register( "demo_block", // 对于 1.21.2 及以上的版本, // 请将 `BlockEntityType.Builder` 替换为 `FabricBlockEntityTypeBuilder`。 BlockEntityType.Builder.create(DemoBlockEntity::new, TutorialBlocks.DEMO_BLOCK).build() ); public static void initialize() { } }