Record Class ConditionalItemModel.Unbaked
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.item.ConditionalItemModel.Unbaked
- All Implemented Interfaces:
ItemModel.Unbaked, ResolvableModel
- Enclosing class:
ConditionalItemModel
public static record ConditionalItemModel.Unbaked(ConditionalItemModelProperty property, ItemModel.Unbaked onTrue, ItemModel.Unbaked onFalse)
extends Record
implements ItemModel.Unbaked
-
Nested Class Summary
Nested classes/interfaces inherited from interface ResolvableModel
ResolvableModel.Resolver -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ConditionalItemModel.Unbaked> private final ItemModel.UnbakedThe field for theonFalserecord component.private final ItemModel.UnbakedThe field for theonTruerecord component.private final ConditionalItemModelPropertyThe field for thepropertyrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionUnbaked(ConditionalItemModelProperty property, ItemModel.Unbaked onTrue, ItemModel.Unbaked onFalse) Creates an instance of aUnbakedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionprivate ItemModelPropertyTestadaptProperty(ConditionalItemModelProperty originalProperty, @Nullable RegistryContextSwapper contextSwapper) bake(ItemModel.BakingContext context) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.onFalse()Returns the value of theonFalserecord component.onTrue()Returns the value of theonTruerecord component.property()Returns the value of thepropertyrecord component.voidresolveDependencies(ResolvableModel.Resolver resolver) private static <T extends ConditionalItemModelProperty>
TswapContext(T originalProperty, RegistryContextSwapper contextSwapper, ClientLevel context) final StringtoString()Returns a string representation of this record class.com.mojang.serialization.MapCodec<ConditionalItemModel.Unbaked> type()
-
Field Details
-
property
The field for thepropertyrecord component. -
onTrue
The field for theonTruerecord component. -
onFalse
The field for theonFalserecord component. -
MAP_CODEC
-
-
Constructor Details
-
Unbaked
public Unbaked(ConditionalItemModelProperty property, ItemModel.Unbaked onTrue, ItemModel.Unbaked onFalse) Creates an instance of aUnbakedrecord class.- Parameters:
property- the value for thepropertyrecord componentonTrue- the value for theonTruerecord componentonFalse- the value for theonFalserecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceItemModel.Unbaked
-
bake
- Specified by:
bakein interfaceItemModel.Unbaked
-
adaptProperty
private ItemModelPropertyTest adaptProperty(ConditionalItemModelProperty originalProperty, @Nullable RegistryContextSwapper contextSwapper) -
swapContext
private static <T extends ConditionalItemModelProperty> T swapContext(T originalProperty, RegistryContextSwapper contextSwapper, ClientLevel context) -
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). -
property
Returns the value of thepropertyrecord component.- Returns:
- the value of the
propertyrecord component
-
onTrue
Returns the value of theonTruerecord component.- Returns:
- the value of the
onTruerecord component
-
onFalse
Returns the value of theonFalserecord component.- Returns:
- the value of the
onFalserecord component
-