Class SoundEntry
java.lang.Object
com.github.darksoulq.abyssallib.server.resource.asset.SoundEntry
Represents a single physical `.ogg` audio variant linked to a broader
SoundEvent.
This class handles the specific logic and metadata configurations uniquely assigned to an individual audio file, such as localized volume, weight probabilities, and RAM streaming directives.
-
Method Summary
Modifier and TypeMethodDescription@NotNull SoundEntryattenuationDistance(int distance) Modifies the distance (in blocks) the sound can traverse before becoming fully attenuated.@NotNull SoundEntrypitch(float pitch) Sets the localized base pitch for this specific variant.@NotNull SoundEntrypreload(boolean preload) Forces the client to cache this sound directly into memory during the resource pack loading screen.@NotNull SoundEntrystream(boolean stream) Sets whether this sound should be streamed dynamically from the hard drive.@NotNull SoundEntrySets the internal JSON entry type.@NotNull SoundEntryvolume(float volume) Sets the localized base volume for this specific variant.@NotNull SoundEntryweight(int weight) Adjusts the RNG chance that this variant is selected when the parent event is triggered.
-
Method Details
-
volume
Sets the localized base volume for this specific variant.- Parameters:
volume- The volume scalar (default is 1.0).- Returns:
- This
SoundEntryinstance for chaining.
-
pitch
Sets the localized base pitch for this specific variant.- Parameters:
pitch- The pitch scalar (default is 1.0).- Returns:
- This
SoundEntryinstance for chaining.
-
weight
Adjusts the RNG chance that this variant is selected when the parent event is triggered.- Parameters:
weight- The probabilistic weight integer (default is 1).- Returns:
- This
SoundEntryinstance for chaining.
-
stream
Sets whether this sound should be streamed dynamically from the hard drive.This should always be set to true for long music tracks or dialogue to prevent RAM exhaustion.
- Parameters:
stream- True to stream from disk, false to cache into RAM.- Returns:
- This
SoundEntryinstance for chaining.
-
attenuationDistance
Modifies the distance (in blocks) the sound can traverse before becoming fully attenuated.- Parameters:
distance- The falloff distance integer (default is 16).- Returns:
- This
SoundEntryinstance for chaining.
-
preload
Forces the client to cache this sound directly into memory during the resource pack loading screen.Useful for UI sounds that must trigger instantly without disk delay.
- Parameters:
preload- True to forcibly load early.- Returns:
- This
SoundEntryinstance for chaining.
-
type
Sets the internal JSON entry type.- Parameters:
type- The type ("file" by default, or "event" to nest existing events).- Returns:
- This
SoundEntryinstance for chaining.
-