It sounds like you are creating a jar mod by manually modifying the game files.
This is discouraged, as it would cause severe incompatibilities with other mods. In fact, jar modding is not supported on this forum.
In your case, you are trying to replace game files. This will fundamentally break Forge (and any other modifications to the game), resulting in not working with any other mods (even other jar mods).