Record Class MusicTrack
java.lang.Object
java.lang.Record
fr.fidorial.world.environment.MusicTrack
- Record Components:
sound- theminecraft:sound_eventkeyminDelay- minimum delay, in ticks, between two playsmaxDelay- maximum delay, in ticks, between two playsreplaceCurrentMusic- whether this track cuts the music already playing
-
Constructor Summary
ConstructorsConstructorDescriptionMusicTrack(Key sound, int minDelay, int maxDelay, boolean replaceCurrentMusic) Creates an instance of aMusicTrackrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmaxDelay()Returns the value of themaxDelayrecord component.intminDelay()Returns the value of theminDelayrecord component.static MusicTrackCreates a track that waits for the current music to end.booleanReturns the value of thereplaceCurrentMusicrecord component.sound()Returns the value of thesoundrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MusicTrack
Creates an instance of aMusicTrackrecord class.- Parameters:
sound- the value for thesoundrecord componentminDelay- the value for theminDelayrecord componentmaxDelay- the value for themaxDelayrecord componentreplaceCurrentMusic- the value for thereplaceCurrentMusicrecord component
-
-
Method Details
-
of
Creates a track that waits for the current music to end.- Parameters:
sound- the sound event keyminDelay- minimum delay in ticksmaxDelay- maximum delay in ticks- Returns:
- the track
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
sound
-
minDelay
-
maxDelay
-
replaceCurrentMusic
public boolean replaceCurrentMusic()Returns the value of thereplaceCurrentMusicrecord component.- Returns:
- the value of the
replaceCurrentMusicrecord component
-