Record Class PigSoundVariant
java.lang.Object
java.lang.Record
net.minecraft.world.entity.animal.pig.PigSoundVariant
public record PigSoundVariant(PigSoundVariant.PigSoundSet adultSounds, PigSoundVariant.PigSoundSet babySounds)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PigSoundVariant.PigSoundSetThe field for theadultSoundsrecord component.private final PigSoundVariant.PigSoundSetThe field for thebabySoundsrecord component.static final com.mojang.serialization.Codec<Holder<PigSoundVariant>> static final com.mojang.serialization.Codec<PigSoundVariant> static final com.mojang.serialization.Codec<PigSoundVariant> static final StreamCodec<RegistryFriendlyByteBuf, Holder<PigSoundVariant>> -
Constructor Summary
ConstructorsConstructorDescriptionPigSoundVariant(PigSoundVariant.PigSoundSet adultSounds, PigSoundVariant.PigSoundSet babySounds) Creates an instance of aPigSoundVariantrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadultSoundsrecord component.Returns the value of thebabySoundsrecord component.private static com.mojang.serialization.Codec<PigSoundVariant> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
adultSounds
The field for theadultSoundsrecord component. -
babySounds
The field for thebabySoundsrecord component. -
DIRECT_CODEC
-
NETWORK_CODEC
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
PigSoundVariant
public PigSoundVariant(PigSoundVariant.PigSoundSet adultSounds, PigSoundVariant.PigSoundSet babySounds) Creates an instance of aPigSoundVariantrecord class.- Parameters:
adultSounds- the value for theadultSoundsrecord componentbabySounds- the value for thebabySoundsrecord component
-
-
Method Details
-
codec
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
adultSounds
Returns the value of theadultSoundsrecord component.- Returns:
- the value of the
adultSoundsrecord component
-
babySounds
Returns the value of thebabySoundsrecord component.- Returns:
- the value of the
babySoundsrecord component
-