Registering blocks is done from your main mod class, or a ModBlocks class method invoked from the main mod class during preInit.
Block myBlock = new CustomBlock();
string registryname = "my_block";
block.setRegistryName(registryname);
block.setUnlocalizedName(block.getRegistryName().to...