Class Sound
java.lang.Object
net.minecraft.client.resources.sounds.Sound
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final ResourceLocation
private final SampledFloat
private final boolean
static final FileToIdConverter
private final boolean
private final Sound.Type
private final SampledFloat
private 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 TypeMethodDescriptionint
getPath()
getPitch()
getSound
(RandomSource pRandomSource) Retrieves the sound associated with the element.getType()
int
void
preloadIfRequired
(SoundEngine pEngine) Preloads the sound if required by the sound engine.boolean
boolean
toString()
-
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:
preloadIfRequired
in 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
-