Class SoundFilterControl

java.lang.Object
net.ixdarklord.coolcatcanvas.api.sound.SoundFilterControl

public final class SoundFilterControl extends Object
Named sound filters from the server (the client side, and what each part does, is SoundFilters and SoundFilter): one small packet to set or clear a filter on a player, which then fades on its own. Players whose client lacks CoolCatLib are skipped.

 SoundFilterControl.set(player, MyMod.id("dazed"), 0.7F, 0.15F, 0.2F, 0.0F, 20);   // muffled and rough, over a second
 SoundFilterControl.clear(player, MyMod.id("dazed"), 60);                          // and back over three
 
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    clear(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation id, int fadeTicks)
    Fades a named filter out on a player's client over fadeTicks, then removes it.
    static void
    set(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation id, float gain, float gainHF, float distortion, float reverb, int fadeTicks)
    Fades a named filter in on a player's client over fadeTicks, replacing any of that name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • set

      public static void set(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation id, float gain, float gainHF, float distortion, float reverb, int fadeTicks)
      Fades a named filter in on a player's client over fadeTicks, replacing any of that name.
      Parameters:
      gain - how loud sounds stay, 0 to 1
      gainHF - how much of their high end they keep, 0 to 1
      distortion - how much of them goes through the distortion, 0 to 1
      reverb - how much of them goes into the reverb, 0 to 1
    • clear

      public static void clear(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation id, int fadeTicks)
      Fades a named filter out on a player's client over fadeTicks, then removes it.