Record Class AmbientSounds

java.lang.Object
java.lang.Record
fr.fidorial.world.environment.AmbientSounds
Record Components:
loop - sound continually looped while inside, or null for none — was effects.ambient_sound
mood - darkness ambience, or null for none — was effects.mood_sound
additions - randomly played sound, or null for none — was effects.additions_sound

public record AmbientSounds(@Nullable Key loop, @Nullable MoodSound mood, @Nullable AdditionsSound additions) extends Record
The minecraft:audio/ambient_sounds environment attribute, which merges the three sound fields biomes used to carry before 1.21.11.
Since:
0.1.0
  • Constructor Details

  • Method Details

    • loop

      public static AmbientSounds loop(Key loop)
      Creates an attribute carrying only a looping sound.
      Parameters:
      loop - the sound event key
      Returns:
      the ambient sounds
    • mood

      public static AmbientSounds mood(MoodSound mood)
      Creates an attribute carrying only a mood sound.
      Parameters:
      mood - the mood sound
      Returns:
      the ambient sounds
    • of

      public static AmbientSounds of(Key loop, MoodSound mood)
      Creates an attribute carrying a looping sound and a mood sound.
      Parameters:
      loop - the sound event key
      mood - the mood sound
      Returns:
      the ambient sounds
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • loop

      public @Nullable Key loop()
      Returns the value of the loop record component.
      Returns:
      the value of the loop record component
    • mood

      public @Nullable MoodSound mood()
      Returns the value of the mood record component.
      Returns:
      the value of the mood record component
    • additions

      public @Nullable AdditionsSound additions()
      Returns the value of the additions record component.
      Returns:
      the value of the additions record component