Package net.minecraft.world.attribute
Record Class BackgroundMusic
java.lang.Object
java.lang.Record
net.minecraft.world.attribute.BackgroundMusic
- Record Components:
defaultMusic-creativeMusic-underwaterMusic-
public record BackgroundMusic(Optional<MusicSound> defaultMusic, Optional<MusicSound> creativeMusic, Optional<MusicSound> underwaterMusic)
extends Record
- Mappings:
Namespace Name named net/minecraft/world/attribute/BackgroundMusicintermediary net/minecraft/class_12194official cdqnamed defaultMusicintermediary comp_5133official dnamed creativeMusicintermediary comp_5134official enamed underwaterMusicintermediary comp_5135official f
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BackgroundMusic> private final Optional<MusicSound> The field for thecreativeMusicrecord component.static final BackgroundMusicprivate final Optional<MusicSound> The field for thedefaultMusicrecord component.static final BackgroundMusicprivate final Optional<MusicSound> The field for theunderwaterMusicrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionBackgroundMusic(Optional<MusicSound> defaultMusic, Optional<MusicSound> creativeMusic, Optional<MusicSound> underwaterMusic) Creates an instance of aBackgroundMusicrecord class.BackgroundMusic(RegistryEntry<SoundEvent> defaultMusic) BackgroundMusic(MusicSound defaultMusic) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecreativeMusicrecord component.Returns the value of thedefaultMusicrecord component.final booleanIndicates whether some other object is "equal to" this one.getCurrent(boolean creative, boolean underwater) final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Returns the value of theunderwaterMusicrecord component.withUnderwater(MusicSound underwater)
-
Field Details
-
defaultMusic
The field for thedefaultMusicrecord component. -
creativeMusic
The field for thecreativeMusicrecord component. -
underwaterMusic
The field for theunderwaterMusicrecord component. -
EMPTY
- Mappings:
Namespace Name Mixin selector named EMPTYLnet/minecraft/world/attribute/BackgroundMusic;EMPTY:Lnet/minecraft/world/attribute/BackgroundMusic;intermediary field_63700Lnet/minecraft/class_12194;field_63700:Lnet/minecraft/class_12194;official aLcdq;a:Lcdq;
-
DEFAULT
- Mappings:
Namespace Name Mixin selector named DEFAULTLnet/minecraft/world/attribute/BackgroundMusic;DEFAULT:Lnet/minecraft/world/attribute/BackgroundMusic;intermediary field_63701Lnet/minecraft/class_12194;field_63701:Lnet/minecraft/class_12194;official bLcdq;b:Lcdq;
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/world/attribute/BackgroundMusic;CODEC:Lcom/mojang/serialization/Codec;intermediary field_63702Lnet/minecraft/class_12194;field_63702:Lcom/mojang/serialization/Codec;official cLcdq;c:Lcom/mojang/serialization/Codec;
-
-
Constructor Details
-
BackgroundMusic
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/world/attribute/BackgroundMusic;<init>(Lnet/minecraft/sound/MusicSound;)Vintermediary <init>Lnet/minecraft/class_12194;<init>(Lnet/minecraft/class_5195;)Vofficial <init>Lcdq;<init>(Lbcx;)V
-
BackgroundMusic
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/world/attribute/BackgroundMusic;<init>(Lnet/minecraft/registry/entry/RegistryEntry;)Vintermediary <init>Lnet/minecraft/class_12194;<init>(Lnet/minecraft/class_6880;)Vofficial <init>Lcdq;<init>(Ljf;)V
-
BackgroundMusic
public BackgroundMusic(Optional<MusicSound> defaultMusic, Optional<MusicSound> creativeMusic, Optional<MusicSound> underwaterMusic) Creates an instance of aBackgroundMusicrecord class.- Parameters:
defaultMusic- the value for thedefaultMusicrecord componentcreativeMusic- the value for thecreativeMusicrecord componentunderwaterMusic- the value for theunderwaterMusicrecord component
-
-
Method Details
-
withUnderwater
- Mappings:
Namespace Name Mixin selector named withUnderwaterLnet/minecraft/world/attribute/BackgroundMusic;withUnderwater(Lnet/minecraft/sound/MusicSound;)Lnet/minecraft/world/attribute/BackgroundMusic;intermediary method_75638Lnet/minecraft/class_12194;method_75638(Lnet/minecraft/class_5195;)Lnet/minecraft/class_12194;official aLcdq;a(Lbcx;)Lcdq;
-
getCurrent
- Mappings:
Namespace Name Mixin selector named getCurrentLnet/minecraft/world/attribute/BackgroundMusic;getCurrent(ZZ)Ljava/util/Optional;intermediary method_75640Lnet/minecraft/class_12194;method_75640(ZZ)Ljava/util/Optional;official aLcdq;a(ZZ)Ljava/util/Optional;
-
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. -
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. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
defaultMusic
Returns the value of thedefaultMusicrecord component.- Returns:
- the value of the
defaultMusicrecord component
-
creativeMusic
Returns the value of thecreativeMusicrecord component.- Returns:
- the value of the
creativeMusicrecord component
-
underwaterMusic
Returns the value of theunderwaterMusicrecord component.- Returns:
- the value of the
underwaterMusicrecord component
-