Package net.minecraft.client.sounds
Class MusicManager
java.lang.Object
net.minecraft.client.sounds.MusicManager
The MusicManager class manages the playing of music in Minecraft.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate floatprivate @Nullable SoundInstanceprivate MusicManager.MusicFrequencyprivate final Minecraftprivate intThe delay until the next song starts.private final RandomSourceprivate static final intThe delay before starting to play the next song.private boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleancanReplace(Music pMusic, SoundInstance pSound) private booleanfadePlaying(float pVolume) @Nullable StringbooleanisPlayingMusic(Music pSelector) voidsetMinutesBetweenSongs(MusicManager.MusicFrequency pMusicFrequency) voidvoidstartPlaying(Music pMusic) voidvoidstopPlaying(Music pMusic) Stops playing the specified Music selector.voidtick()
-
Field Details
-
STARTING_DELAY
private static final int STARTING_DELAYThe delay before starting to play the next song.- See Also:
-
random
-
minecraft
-
currentMusic
-
gameMusicFrequency
-
currentGain
private float currentGain -
nextSongDelay
private int nextSongDelayThe delay until the next song starts. -
toastShown
private boolean toastShown
-
-
Constructor Details
-
MusicManager
-
-
Method Details
-
tick
public void tick() -
canReplace
-
startPlaying
-
showNowPlayingToastIfNeeded
public void showNowPlayingToastIfNeeded() -
stopPlaying
Stops playing the specified Music selector.- Parameters:
pMusic- the Music selector to stop playing
-
stopPlaying
public void stopPlaying() -
fadePlaying
private boolean fadePlaying(float pVolume) -
isPlayingMusic
-
getCurrentMusicTranslationKey
-
setMinutesBetweenSongs
-