Record Class Variant
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.block.model.Variant
- All Implemented Interfaces:
BlockModelPart.Unbaked,ResolvableModel
public record Variant(ResourceLocation modelLocation, Variant.SimpleModelState modelState)
extends Record
implements BlockModelPart.Unbaked
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.client.resources.model.ResolvableModel
ResolvableModel.Resolver -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Variant> static final com.mojang.serialization.MapCodec<Variant> private final ResourceLocationThe field for themodelLocationrecord component.private final Variant.SimpleModelStateThe field for themodelStaterecord component. -
Constructor Summary
ConstructorsConstructorDescriptionVariant(ResourceLocation p_404842_) Variant(ResourceLocation modelLocation, Variant.SimpleModelState modelState) Creates an instance of aVariantrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbake(ModelBaker pModelBaker) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themodelLocationrecord component.Returns the value of themodelStaterecord component.voidresolveDependencies(ResolvableModel.Resolver pResolver) final StringtoString()Returns a string representation of this record class.with(VariantMutator pMutator) withModel(ResourceLocation pModelLocation) withState(Variant.SimpleModelState pModelState) withUvLock(boolean pUvLock)
-
Field Details
-
modelLocation
The field for themodelLocationrecord component. -
modelState
The field for themodelStaterecord component. -
MAP_CODEC
-
CODEC
-
-
Constructor Details
-
Variant
-
Variant
Creates an instance of aVariantrecord class.- Parameters:
modelLocation- the value for themodelLocationrecord componentmodelState- the value for themodelStaterecord component
-
-
Method Details
-
withXRot
-
withYRot
-
withUvLock
-
withModel
-
withState
-
with
-
bake
- Specified by:
bakein interfaceBlockModelPart.Unbaked
-
resolveDependencies
- Specified by:
resolveDependenciesin interfaceResolvableModel
-
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). -
modelLocation
Returns the value of themodelLocationrecord component.- Returns:
- the value of the
modelLocationrecord component
-
modelState
Returns the value of themodelStaterecord component.- Returns:
- the value of the
modelStaterecord component
-