Class SoundFilterControl
java.lang.Object
net.ixdarklord.coolcatcanvas.api.sound.SoundFilterControl
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 TypeMethodDescriptionstatic voidclear(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation id, int fadeTicks) Fades a named filter out on a player's client overfadeTicks, then removes it.static voidset(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 overfadeTicks, replacing any of that name.
-
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 overfadeTicks, replacing any of that name.- Parameters:
gain- how loud sounds stay, 0 to 1gainHF- how much of their high end they keep, 0 to 1distortion- how much of them goes through the distortion, 0 to 1reverb- 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 overfadeTicks, then removes it.
-