Record Class ChickenVariant
java.lang.Object
java.lang.Record
net.minecraft.world.entity.animal.ChickenVariant
- All Implemented Interfaces:
PriorityProvider<SpawnContext,
SpawnCondition>
public record ChickenVariant(ModelAndTexture<ChickenVariant.ModelType> modelAndTexture, SpawnPrioritySelectors spawnConditions)
extends Record
implements PriorityProvider<SpawnContext,SpawnCondition>
-
Nested Class Summary
Nested ClassesNested 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 TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<Holder<ChickenVariant>> static final com.mojang.serialization.Codec
<ChickenVariant> private final ModelAndTexture
<ChickenVariant.ModelType> The field for themodelAndTexture
record component.static final com.mojang.serialization.Codec
<ChickenVariant> private final SpawnPrioritySelectors
The field for thespawnConditions
record component.static final StreamCodec
<RegistryFriendlyByteBuf, Holder<ChickenVariant>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ChickenVariant
(ModelAndTexture<ChickenVariant.ModelType> p_401944_) ChickenVariant
(ModelAndTexture<ChickenVariant.ModelType> modelAndTexture, SpawnPrioritySelectors spawnConditions) Creates an instance of aChickenVariant
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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 themodelAndTexture
record component.Returns the value of thespawnConditions
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
modelAndTexture
The field for themodelAndTexture
record component. -
spawnConditions
The field for thespawnConditions
record component. -
DIRECT_CODEC
-
NETWORK_CODEC
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
ChickenVariant
-
ChickenVariant
public ChickenVariant(ModelAndTexture<ChickenVariant.ModelType> modelAndTexture, SpawnPrioritySelectors spawnConditions) Creates an instance of aChickenVariant
record class.- Parameters:
modelAndTexture
- the value for themodelAndTexture
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)
. -
modelAndTexture
Returns the value of themodelAndTexture
record component.- Returns:
- the value of the
modelAndTexture
record component
-
spawnConditions
Returns the value of thespawnConditions
record component.- Returns:
- the value of the
spawnConditions
record component
-