Record Class ModelAndTexture<T>
java.lang.Object
java.lang.Record
net.minecraft.world.entity.variant.ModelAndTexture<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientAsset
The field for theasset
record component.private final T
The field for themodel
record component. -
Constructor Summary
ConstructorsConstructorDescriptionModelAndTexture
(T model, ClientAsset asset) Creates an instance of aModelAndTexture
record class.ModelAndTexture
(T p_400126_, ResourceLocation p_400299_) -
Method Summary
Modifier and TypeMethodDescriptionasset()
Returns the value of theasset
record component.static <T> com.mojang.serialization.MapCodec
<ModelAndTexture<T>> codec
(com.mojang.serialization.Codec<T> p_399564_, T p_400177_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.model()
Returns the value of themodel
record component.static <T> StreamCodec
<RegistryFriendlyByteBuf, ModelAndTexture<T>> streamCodec
(StreamCodec<? super RegistryFriendlyByteBuf, T> p_400232_) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
model
The field for themodel
record component. -
asset
The field for theasset
record component.
-
-
Constructor Details
-
ModelAndTexture
-
ModelAndTexture
Creates an instance of aModelAndTexture
record class.- Parameters:
model
- the value for themodel
record componentasset
- the value for theasset
record component
-
-
Method Details
-
codec
public static <T> com.mojang.serialization.MapCodec<ModelAndTexture<T>> codec(com.mojang.serialization.Codec<T> p_399564_, T p_400177_) -
streamCodec
public static <T> StreamCodec<RegistryFriendlyByteBuf,ModelAndTexture<T>> streamCodec(StreamCodec<? super RegistryFriendlyByteBuf, T> p_400232_) -
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 themodel
record component.- Returns:
- the value of the
model
record component
-
asset
Returns the value of theasset
record component.- Returns:
- the value of the
asset
record component
-