Interface SoundFilterProvider

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface SoundFilterProvider
Says how a sound comes through to the listener; registered with SoundFilters.register(net.ixdarklord.coolcatcanvas.api.client.sound.SoundFilterProvider). It is asked about every sound the game plays, music and the menus included (SoundContext.relative()), as it starts and as it moves. It is asked on the sound thread, so it must be quick and read only state that is safe to read from there (an immutable snapshot the game thread swaps in, for example).

 SoundFilters.register(sound -> sound.source() == SoundSource.HOSTILE ? SoundFilter.muffled(0.5F) : SoundFilter.NONE);
 SoundFilters.register(SoundFilterProvider.inWorld(position -> walls.filter(position)));