This is a common library which works for both forge and fabric but is incomplete without one of its loaders.
https://github.com/CreativeMD/ForgeMods
Created by @CreativeMD: https://github.com/FreezePhoenix/CreativeLoaderForge
Created by @FreezePhoenix: https://github.com/FreezePhoenix/CreativeLoaderFabric
You can find the formatter I use for eclipse here.
Feel free to use this mod as a dependency, but you may not copy add files to your mod directly.