That's because this class is never ever even "seen" by Minecraft.
(You HAVE to call setRegistryName(string) in your block. Either directly in the constructor or later down the road when you register it. (setRegistryName returns the block itself, with the registryName set))
Create a new class, which you will be using for registration of blocks (and items (held blocks & blocks stored in inventories etc are item (technically ItemBlocks)))
Annotate this class with @EventBusSubscriber
Create a public static void method, and subscribe it to the Register<Block> event.
Now, I like to put all my blocks in a list/set collection, and for that collection, call forEach(event.getRegistry::register).
Of course, you can always just use a for-each loop and call event.getRegistry().register(block).
If you do not want to use a collection, use event.getRegistry().registerAll(), and supply the registerAll all your blocks. (block1, block2... blockn)
Now, create another public static void method, but subscribe to the Register<Item> event instead.
For each block you registered in just now, you will need to create a corresponding ItemBlock (so that it can exist in inventories & your hand etc)
Either for-each loop over the collection, create a new ItemBlock(block) & set it's RegistryName to the block's RegistryName and register it in the event, OR use another lambda expression:
blockCollection.stream().map(block -> new ItemBlock(block).setRegistryName(block.getRegistryName())).collect(Collectors.toList()).forEach(event.getRegistry()::register);
Wee bit messier than before. (for each block in this collection(that contains blocks!), create a new ItemBlock, and set it's RegistryName to the block's RegistryName. Put this new ItemBlock into a new list, and for each thing in this new list, register).
if you have any normal items, you can simply do the same thing we did with blocks, and call forEach(event.getRegistry::register) on the item-list.
(or as said stick to a simple for-each loop)