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(Identifier modelLocation, Variant.SimpleModelState modelState)
extends Record
implements BlockModelPart.Unbaked
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface ResolvableModel
ResolvableModel.Resolver -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Variant> static final com.mojang.serialization.MapCodec<Variant> private final IdentifierThe field for themodelLocationrecord component.private final Variant.SimpleModelStateThe field for themodelStaterecord component. -
Constructor Summary
ConstructorsConstructorDescriptionVariant(Identifier modelLocation) Variant(Identifier modelLocation, Variant.SimpleModelState modelState) Creates an instance of aVariantrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbake(ModelBaker modelBakery) 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 resolver) final StringtoString()Returns a string representation of this record class.with(VariantMutator mutator) withModel(Identifier modelLocation) withState(Variant.SimpleModelState modelState) withUvLock(boolean uvLock)
-
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
-
withZRot
-
withUvLock
-
withModel
-
withState
-
with
-
bake
- Specified by:
bakein interfaceBlockModelPart.Unbaked
-
resolveDependencies
- Specified by:
resolveDependenciesin interfaceResolvableModel
-
toString
-
hashCode
-
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
-