Class SoundManager
java.lang.Object
net.neoforged.neoforge.resource.ContextAwareReloadListener
net.minecraft.server.packs.resources.SimplePreparableReloadListener<SoundManager.Preparations>
net.minecraft.client.sounds.SoundManager
- All Implemented Interfaces:
PreparableReloadListener
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface PreparableReloadListener
PreparableReloadListener.PreparationBarrier, PreparableReloadListener.SharedState, PreparableReloadListener.StateKey<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Soundstatic final Identifierprivate static final com.google.gson.Gsonstatic final Soundstatic final WeighedSoundEventsstatic final Identifierprivate static final org.slf4j.Loggerprivate final Map<Identifier, WeighedSoundEvents> private static final com.google.gson.reflect.TypeToken<Map<String, SoundEventRegistration>> private final Map<Identifier, Resource> private final SoundEngineprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(SoundEventListener listener) protected voidapply(SoundManager.Preparations preparations, ResourceManager manager, ProfilerFiller profiler) voiddestroy()voidvoid@Nullable WeighedSoundEventsgetSoundEvent(Identifier location) booleanisActive(SoundInstance instance) voidpauseAllExcept(SoundSource... ignoredSources) play(SoundInstance instance) voidplayDelayed(SoundInstance instance, int delay) protected SoundManager.Preparationsprepare(ResourceManager manager, ProfilerFiller profiler) voidqueueTickingSound(TickableSoundInstance instance) voidrefreshCategoryVolume(SoundSource category) voidreload()voidremoveListener(SoundEventListener listener) voidresume()voidstop()voidstop(SoundInstance soundInstance) voidstop(@Nullable Identifier sound, @Nullable SoundSource source) voidtick(boolean paused) voidupdateCategoryVolume(SoundSource source, float gain) voidupdateSource(Camera camera) private static booleanvalidateSoundResource(Sound sound, Identifier eventLocation, ResourceProvider resourceProvider) Methods inherited from class SimplePreparableReloadListener
reloadMethods inherited from class ContextAwareReloadListener
getContext, getRegistryLookup, injectContext, makeConditionalOps, makeConditionalOpsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PreparableReloadListener
getName, prepareSharedState
-
Field Details
-
EMPTY_SOUND_LOCATION
-
EMPTY_SOUND
-
INTENTIONALLY_EMPTY_SOUND_LOCATION
-
INTENTIONALLY_EMPTY_SOUND_EVENT
-
INTENTIONALLY_EMPTY_SOUND
-
LOGGER
private static final org.slf4j.Logger LOGGER -
SOUNDS_PATH
- See Also:
-
GSON
private static final com.google.gson.Gson GSON -
SOUND_EVENT_REGISTRATION_TYPE
private static final com.google.gson.reflect.TypeToken<Map<String, SoundEventRegistration>> SOUND_EVENT_REGISTRATION_TYPE -
registry
-
soundEngine
-
soundCache
-
-
Constructor Details
-
SoundManager
-
-
Method Details
-
prepare
- Specified by:
preparein classSimplePreparableReloadListener<SoundManager.Preparations>
-
apply
protected void apply(SoundManager.Preparations preparations, ResourceManager manager, ProfilerFiller profiler) - Specified by:
applyin classSimplePreparableReloadListener<SoundManager.Preparations>
-
getAvailableSoundDevices
-
getListenerTransform
-
validateSoundResource
private static boolean validateSoundResource(Sound sound, Identifier eventLocation, ResourceProvider resourceProvider) -
getSoundEvent
-
getAvailableSounds
-
queueTickingSound
-
play
-
playDelayed
-
updateSource
-
pauseAllExcept
-
stop
public void stop() -
destroy
public void destroy() -
emergencyShutdown
public void emergencyShutdown() -
tick
public void tick(boolean paused) -
resume
public void resume() -
refreshCategoryVolume
-
stop
-
updateCategoryVolume
-
isActive
-
addListener
-
removeListener
-
stop
-
getChannelDebugString
-
getSoundCacheDebugStats
-
reload
public void reload()
-