Record Class ModelAndTexture<T>
java.lang.Object
java.lang.Record
net.minecraft.world.entity.variant.ModelAndTexture<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientAssetThe field for theassetrecord component.private final TThe field for themodelrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionModelAndTexture(T model, ClientAsset asset) Creates an instance of aModelAndTexturerecord class.ModelAndTexture(T p_400126_, ResourceLocation p_400299_) -
Method Summary
Modifier and TypeMethodDescriptionasset()Returns the value of theassetrecord component.static <T> com.mojang.serialization.MapCodec<ModelAndTexture<T>> codec(com.mojang.serialization.Codec<T> pModelCodec, T pDefaultModel) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.model()Returns the value of themodelrecord component.static <T> StreamCodec<RegistryFriendlyByteBuf, ModelAndTexture<T>> streamCodec(StreamCodec<? super RegistryFriendlyByteBuf, T> pModelCodec) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
model
The field for themodelrecord component. -
asset
The field for theassetrecord component.
-
-
Constructor Details
-
ModelAndTexture
-
ModelAndTexture
Creates an instance of aModelAndTexturerecord class.- Parameters:
model- the value for themodelrecord componentasset- the value for theassetrecord component
-
-
Method Details
-
codec
public static <T> com.mojang.serialization.MapCodec<ModelAndTexture<T>> codec(com.mojang.serialization.Codec<T> pModelCodec, T pDefaultModel) -
streamCodec
public static <T> StreamCodec<RegistryFriendlyByteBuf,ModelAndTexture<T>> streamCodec(StreamCodec<? super RegistryFriendlyByteBuf, T> pModelCodec) -
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). -
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
asset
Returns the value of theassetrecord component.- Returns:
- the value of the
assetrecord component
-