Record Class SelectItemModel.UnbakedSwitch<P extends SelectItemModelProperty<T>,T>
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.item.SelectItemModel.UnbakedSwitch<P,T>
- Enclosing class:
SelectItemModel<T>
public static record SelectItemModel.UnbakedSwitch<P extends SelectItemModelProperty<T>,T> (P extends SelectItemModelProperty<T> property, List<SelectItemModel.SwitchCase<T>> cases)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<SelectItemModel.SwitchCase<T>> The field for thecasesrecord component.static final com.mojang.serialization.MapCodec<SelectItemModel.UnbakedSwitch<?, ?>> private final PThe field for thepropertyrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionUnbakedSwitch(P property, List<SelectItemModel.SwitchCase<T>> cases) Creates an instance of aUnbakedSwitchrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbake(ItemModel.BakingContext pBakingContext, ItemModel pModel) cases()Returns the value of thecasesrecord component.private SelectItemModel.ModelSelector<T> createModelGetter(it.unimi.dsi.fastutil.objects.Object2ObjectMap<T, ItemModel> pModels, RegistryContextSwapper pContextSwapper) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.property()Returns the value of thepropertyrecord component.voidresolveDependencies(ResolvableModel.Resolver pResolver) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
property
The field for thepropertyrecord component. -
cases
The field for thecasesrecord component. -
MAP_CODEC
-
-
Constructor Details
-
UnbakedSwitch
Creates an instance of aUnbakedSwitchrecord class.- Parameters:
property- the value for thepropertyrecord componentcases- the value for thecasesrecord component
-
-
Method Details
-
bake
-
createModelGetter
private SelectItemModel.ModelSelector<T> createModelGetter(it.unimi.dsi.fastutil.objects.Object2ObjectMap<T, ItemModel> pModels, @Nullable RegistryContextSwapper pContextSwapper) -
resolveDependencies
-
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
-
cases
Returns the value of thecasesrecord component.- Returns:
- the value of the
casesrecord component
-