Package net.minecraft.client.sound
Class SoundManager
java.lang.Object
net.minecraft.resource.SinglePreparationResourceReloader<SoundManager.SoundList>
net.minecraft.client.sound.SoundManager
- All Implemented Interfaces:
ResourceReloader
@Environment(CLIENT) public class SoundManager extends SinglePreparationResourceReloader<SoundManager.SoundList>
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSoundManager.SoundListNested classes/interfaces inherited from interface net.minecraft.resource.ResourceReloader
ResourceReloader.Synchronizer -
Field Summary
Fields Modifier and Type Field Description private static GsonGSONprivate static LoggerLOGGERstatic SoundMISSING_SOUNDprivate Map<Identifier,WeightedSoundSet>soundsprivate SoundSystemsoundSystemprivate static TypeToken<Map<String,SoundEntry>>TYPE -
Constructor Summary
Constructors Constructor Description SoundManager(ResourceManager resourceManager, GameOptions gameOptions) -
Method Summary
Modifier and Type Method Description protected voidapply(SoundManager.SoundList soundList, ResourceManager resourceManager, Profiler profiler)Handles the prepared intermediate object.voidclose()WeightedSoundSetget(Identifier id)StringgetDebugString()Collection<Identifier>getKeys()booleanisPlaying(SoundInstance sound)private static booleanisSoundResourcePresent(Sound sound, Identifier id, ResourceManager resourceManager)voidpauseAll()voidplay(SoundInstance sound)voidplay(SoundInstance sound, int delay)voidplayNextTick(TickableSoundInstance sound)protected SoundManager.SoundListprepare(ResourceManager resourceManager, Profiler profiler)Prepares the intermediate object.voidregisterListener(SoundInstanceListener listener)voidresumeAll()voidstop(SoundInstance sound)voidstopAll()voidstopSounds(Identifier id, SoundCategory soundCategory)voidtick(boolean bool)voidunregisterListener(SoundInstanceListener listener)voidupdateListenerPosition(Camera camera)voidupdateSoundVolume(SoundCategory category, float volume)Methods inherited from class net.minecraft.resource.SinglePreparationResourceReloader
reloadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.resource.ResourceReloader
getName
-
Field Details
-
MISSING_SOUND
-
LOGGER
-
GSON
-
TYPE
-
sounds
-
soundSystem
-
-
Constructor Details
-
SoundManager
-
-
Method Details
-
prepare
Description copied from class:SinglePreparationResourceReloaderPrepares the intermediate object.This method is called in the prepare executor in a reload.
- Specified by:
preparein classSinglePreparationResourceReloader<SoundManager.SoundList>- Parameters:
resourceManager- the resource managerprofiler- the prepare profiler- Returns:
- the prepared object
-
apply
protected void apply(SoundManager.SoundList soundList, ResourceManager resourceManager, Profiler profiler)Description copied from class:SinglePreparationResourceReloaderHandles the prepared intermediate object.This method is called in the apply executor, or the game engine, in a reload.
- Specified by:
applyin classSinglePreparationResourceReloader<SoundManager.SoundList>- Parameters:
soundList- the prepared objectresourceManager- the resource managerprofiler- the apply profiler
-
isSoundResourcePresent
private static boolean isSoundResourcePresent(Sound sound, Identifier id, ResourceManager resourceManager) -
get
-
getKeys
-
playNextTick
-
play
-
play
-
updateListenerPosition
-
pauseAll
public void pauseAll() -
stopAll
public void stopAll() -
close
public void close() -
tick
public void tick(boolean bool) -
resumeAll
public void resumeAll() -
updateSoundVolume
-
stop
-
isPlaying
-
registerListener
-
unregisterListener
-
stopSounds
-
getDebugString
-