Class Sound
java.lang.Object
net.minecraft.client.resources.sounds.Sound
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final ResourceLocationprivate final SampledFloatprivate final booleanstatic final FileToIdConverterprivate final booleanprivate final Sound.Typeprivate final SampledFloatprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionSound(ResourceLocation pLocation, SampledFloat pVolume, SampledFloat pPitch, int pWeight, Sound.Type pType, boolean pStream, boolean pPreload, int pAttenuationDistance) -
Method Summary
Modifier and TypeMethodDescriptionintgetPath()getPitch()getSound(RandomSource pRandomSource) Retrieves the sound associated with the element.getType()intvoidpreloadIfRequired(SoundEngine pEngine) Preloads the sound if required by the sound engine.booleanbooleantoString()
-
Field Details
-
SOUND_LISTER
-
location
-
volume
-
pitch
-
weight
private final int weight -
type
-
stream
private final boolean stream -
preload
private final boolean preload -
attenuationDistance
private final int attenuationDistance
-
-
Constructor Details
-
Sound
public Sound(ResourceLocation pLocation, SampledFloat pVolume, SampledFloat pPitch, int pWeight, Sound.Type pType, boolean pStream, boolean pPreload, int pAttenuationDistance)
-
-
Method Details
-
getLocation
-
getPath
-
getVolume
-
getPitch
-
getWeight
public int getWeight() -
getSound
Retrieves the sound associated with the element. The sound is obtained using the provided random source. -
preloadIfRequired
Preloads the sound if required by the sound engine. This method is called to preload the sound associated with the element into the sound engine, ensuring it is ready for playback.- Specified by:
preloadIfRequiredin interfaceWeighted<Sound>- Parameters:
pEngine- the sound engine used for sound preloading
-
getType
-
shouldStream
public boolean shouldStream() -
shouldPreload
public boolean shouldPreload() -
getAttenuationDistance
public int getAttenuationDistance() -
toString
-