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.Unbaked
The field for theonFalse
record component.private final ItemModel.Unbaked
The field for theonTrue
record component.private final ConditionalItemModelProperty
The field for theproperty
record component. -
Constructor Summary
ConstructorsConstructorDescriptionUnbaked
(ConditionalItemModelProperty property, ItemModel.Unbaked onTrue, ItemModel.Unbaked onFalse) Creates an instance of aUnbaked
record class. -
Method Summary
Modifier and TypeMethodDescriptionprivate ItemModelPropertyTest
adaptProperty
(ConditionalItemModelProperty p_399789_, RegistryContextSwapper p_400165_) bake
(ItemModel.BakingContext p_388309_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.onFalse()
Returns the value of theonFalse
record component.onTrue()
Returns the value of theonTrue
record component.property()
Returns the value of theproperty
record component.void
resolveDependencies
(ResolvableModel.Resolver p_388796_) private static <T extends ConditionalItemModelProperty>
TswapContext
(T p_399529_, RegistryContextSwapper p_399879_, ClientLevel p_399861_) final String
toString()
Returns a string representation of this record class.com.mojang.serialization.MapCodec
<ConditionalItemModel.Unbaked> type()
-
Field Details
-
property
The field for theproperty
record component. -
onTrue
The field for theonTrue
record component. -
onFalse
The field for theonFalse
record component. -
MAP_CODEC
-
-
Constructor Details
-
Unbaked
public Unbaked(ConditionalItemModelProperty property, ItemModel.Unbaked onTrue, ItemModel.Unbaked onFalse) Creates an instance of aUnbaked
record class.- Parameters:
property
- the value for theproperty
record componentonTrue
- the value for theonTrue
record componentonFalse
- the value for theonFalse
record component
-
-
Method Details
-
type
- Specified by:
type
in interfaceItemModel.Unbaked
-
bake
- Specified by:
bake
in interfaceItemModel.Unbaked
-
adaptProperty
private ItemModelPropertyTest adaptProperty(ConditionalItemModelProperty p_399789_, @Nullable RegistryContextSwapper p_400165_) -
swapContext
private static <T extends ConditionalItemModelProperty> T swapContext(T p_399529_, RegistryContextSwapper p_399879_, ClientLevel p_399861_) -
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)
. -
property
Returns the value of theproperty
record component.- Returns:
- the value of the
property
record component
-
onTrue
Returns the value of theonTrue
record component.- Returns:
- the value of the
onTrue
record component
-
onFalse
Returns the value of theonFalse
record component.- Returns:
- the value of the
onFalse
record component
-