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 ResourceLocation
The field for themodelLocation
record component.private final Variant.SimpleModelState
The field for themodelState
record component. -
Constructor Summary
ConstructorsConstructorDescriptionVariant
(ResourceLocation p_404842_) Variant
(ResourceLocation modelLocation, Variant.SimpleModelState modelState) Creates an instance of aVariant
record class. -
Method Summary
Modifier and TypeMethodDescriptionbake
(ModelBaker p_410762_) final 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 themodelLocation
record component.Returns the value of themodelState
record component.void
resolveDependencies
(ResolvableModel.Resolver p_410425_) final String
toString()
Returns a string representation of this record class.with
(VariantMutator p_405775_) withModel
(ResourceLocation p_405850_) withState
(Variant.SimpleModelState p_404847_) withUvLock
(boolean p_405100_)
-
Field Details
-
modelLocation
The field for themodelLocation
record component. -
modelState
The field for themodelState
record component. -
MAP_CODEC
-
CODEC
-
-
Constructor Details
-
Variant
-
Variant
Creates an instance of aVariant
record class.- Parameters:
modelLocation
- the value for themodelLocation
record componentmodelState
- the value for themodelState
record component
-
-
Method Details
-
withXRot
-
withYRot
-
withUvLock
-
withModel
-
withState
-
with
-
bake
- Specified by:
bake
in interfaceBlockModelPart.Unbaked
-
resolveDependencies
- Specified by:
resolveDependencies
in 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 themodelLocation
record component.- Returns:
- the value of the
modelLocation
record component
-
modelState
Returns the value of themodelState
record component.- Returns:
- the value of the
modelState
record component
-