Record Class ItemBlockState
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.item.properties.select.ItemBlockState
- All Implemented Interfaces:
SelectItemModelProperty<String>
public record ItemBlockState(String property)
extends Record
implements SelectItemModelProperty<String>
-
Nested Class Summary
Nested classes/interfaces inherited from interface SelectItemModelProperty
SelectItemModelProperty.Type<P,T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for thepropertyrecord component.static final SelectItemModelProperty.Type<ItemBlockState, String> static final com.mojang.serialization.codecs.PrimitiveCodec<String> -
Constructor Summary
ConstructorsConstructorDescriptionItemBlockState(String property) Creates an instance of aItemBlockStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@Nullable Stringget(ItemStack itemStack, @Nullable ClientLevel level, @Nullable LivingEntity owner, int seed, ItemDisplayContext displayContext) final inthashCode()Returns a hash code value for this object.property()Returns the value of thepropertyrecord component.final StringtoString()Returns a string representation of this record class.type()com.mojang.serialization.Codec<String>
-
Field Details
-
property
The field for thepropertyrecord component. -
VALUE_CODEC
-
TYPE
-
-
Constructor Details
-
ItemBlockState
Creates an instance of aItemBlockStaterecord class.- Parameters:
property- the value for thepropertyrecord component
-
-
Method Details
-
get
public @Nullable String get(ItemStack itemStack, @Nullable ClientLevel level, @Nullable LivingEntity owner, int seed, ItemDisplayContext displayContext) - Specified by:
getin interfaceSelectItemModelProperty<String>
-
type
- Specified by:
typein interfaceSelectItemModelProperty<String>
-
valueCodec
- Specified by:
valueCodecin interfaceSelectItemModelProperty<String>
-
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
-