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 net.minecraft.client.resources.model.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 pProperty, RegistryContextSwapper pContextSwapper) bake(ItemModel.BakingContext p_388309_) 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 p_388796_) private static <T extends ConditionalItemModelProperty>
TswapContext(T pProperty, RegistryContextSwapper pContextSwapper, ClientLevel pLevel) 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 pProperty, @Nullable RegistryContextSwapper pContextSwapper) -
swapContext
private static <T extends ConditionalItemModelProperty> T swapContext(T pProperty, RegistryContextSwapper pContextSwapper, ClientLevel pLevel) -
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). -
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
-