Package me.hackware.api.util
Enum Class NotificationSound
- All Implemented Interfaces:
Serializable,Comparable<NotificationSound>,Constable
Shared sound presets for notification modules.
Each preset wraps a SoundEvent supplier, including custom sounds
bundled in our assets folder.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.sounds.SoundEventget()voidplay(net.minecraft.world.entity.player.Player player) Play the preset sound at default volume/pitch.voidplay(net.minecraft.world.entity.player.Player player, float volume, float pitch) Play the preset sound with the given volume and pitch.static voidRegisters all customSoundEvents in the sound registry.static NotificationSoundReturns the enum constant of this class with the specified name.static NotificationSound[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
-
ANVIL
-
BEACON
-
BELL
-
CHIME
-
CHIRP
-
CLICK
-
COINS
-
DOINK
-
EXPERIENCE
-
FORTNITE
-
GTADEATH
-
GW2
-
HEADSHOT
-
LEVELUP
-
NOTE
-
PIPES
-
PLING
-
RING
-
SON
-
TACOBELL
-
TOTEM
-
UHOH
-
UWU
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
get
public net.minecraft.sounds.SoundEvent get() -
play
public void play(net.minecraft.world.entity.player.Player player) Play the preset sound at default volume/pitch. -
play
public void play(net.minecraft.world.entity.player.Player player, float volume, float pitch) Play the preset sound with the given volume and pitch.Everything — vanilla and custom alike — goes through the SoundManager. Our own oggs carry an HWID tracker in release builds that the vanilla decoder rejects; that is stripped at load time by
SoundBufferLibraryMixin, not by playing them ourselves. Hand-rolled OpenAL playback shares its object ids with the sound engine, and a stray free there corrupts the engine's cached buffers. -
registerSounds
public static void registerSounds()Registers all customSoundEvents in the sound registry. Must be called during mod initialization (e.g.onInitializeClient).
-