Record Class PigVariant
java.lang.Object
java.lang.Record
net.minecraft.world.entity.animal.PigVariant
- All Implemented Interfaces:
PriorityProvider<SpawnContext,SpawnCondition>
public record PigVariant(ModelAndTexture<PigVariant.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<PigVariant>> static final com.mojang.serialization.Codec<PigVariant> private final ModelAndTexture<PigVariant.ModelType> The field for themodelAndTexturerecord component.static final com.mojang.serialization.Codec<PigVariant> private final SpawnPrioritySelectorsThe field for thespawnConditionsrecord component.static final StreamCodec<RegistryFriendlyByteBuf, Holder<PigVariant>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePigVariant(ModelAndTexture<PigVariant.ModelType> p_400077_) PigVariant(ModelAndTexture<PigVariant.ModelType> modelAndTexture, SpawnPrioritySelectors spawnConditions) Creates an instance of aPigVariantrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themodelAndTexturerecord component.Returns the value of thespawnConditionsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
modelAndTexture
The field for themodelAndTexturerecord component. -
spawnConditions
The field for thespawnConditionsrecord component. -
DIRECT_CODEC
-
NETWORK_CODEC
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
PigVariant
-
PigVariant
public PigVariant(ModelAndTexture<PigVariant.ModelType> modelAndTexture, SpawnPrioritySelectors spawnConditions) Creates an instance of aPigVariantrecord class.- Parameters:
modelAndTexture- the value for themodelAndTexturerecord componentspawnConditions- the value for thespawnConditionsrecord component
-
-
Method Details
-
selectors
- Specified by:
selectorsin 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 themodelAndTexturerecord component.- Returns:
- the value of the
modelAndTexturerecord component
-
spawnConditions
Returns the value of thespawnConditionsrecord component.- Returns:
- the value of the
spawnConditionsrecord component
-