Record Class CatVariant
java.lang.Object
java.lang.Record
net.minecraft.world.entity.animal.CatVariant
- All Implemented Interfaces:
PriorityProvider<SpawnContext,
SpawnCondition>
public record CatVariant(ClientAsset assetInfo, SpawnPrioritySelectors spawnConditions)
extends Record
implements PriorityProvider<SpawnContext,SpawnCondition>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.entity.variant.PriorityProvider
PriorityProvider.Selector<Context,
Condition extends PriorityProvider.SelectorCondition<Context>>, PriorityProvider.SelectorCondition<C>, PriorityProvider.UnpackedEntry<C, T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientAsset
The field for theassetInfo
record component.static final com.mojang.serialization.Codec
<Holder<CatVariant>> static final com.mojang.serialization.Codec
<CatVariant> static final com.mojang.serialization.Codec
<CatVariant> private final SpawnPrioritySelectors
The field for thespawnConditions
record component.static final StreamCodec
<RegistryFriendlyByteBuf, Holder<CatVariant>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
CatVariant
(ClientAsset p_400062_) CatVariant
(ClientAsset assetInfo, SpawnPrioritySelectors spawnConditions) Creates an instance of aCatVariant
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theassetInfo
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thespawnConditions
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
assetInfo
The field for theassetInfo
record component. -
spawnConditions
The field for thespawnConditions
record component. -
DIRECT_CODEC
-
NETWORK_CODEC
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
CatVariant
-
CatVariant
Creates an instance of aCatVariant
record class.- Parameters:
assetInfo
- the value for theassetInfo
record componentspawnConditions
- the value for thespawnConditions
record component
-
-
Method Details
-
selectors
- Specified by:
selectors
in interfacePriorityProvider<SpawnContext,
SpawnCondition>
-
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)
. -
assetInfo
Returns the value of theassetInfo
record component.- Returns:
- the value of the
assetInfo
record component
-
spawnConditions
Returns the value of thespawnConditions
record component.- Returns:
- the value of the
spawnConditions
record component
-