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 net.minecraft.client.renderer.item.properties.select.SelectItemModelProperty
SelectItemModelProperty.Type<P extends SelectItemModelProperty<T>,
T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
The field for theproperty
record component.static final SelectItemModelProperty.Type
<ItemBlockState, String> static final com.mojang.serialization.codecs.PrimitiveCodec
<String> -
Constructor Summary
ConstructorsConstructorDescriptionItemBlockState
(String property) Creates an instance of aItemBlockState
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.get
(ItemStack p_387708_, ClientLevel p_388625_, LivingEntity p_388880_, int p_388899_, ItemDisplayContext p_388088_) final int
hashCode()
Returns a hash code value for this object.property()
Returns the value of theproperty
record component.final String
toString()
Returns a string representation of this record class.type()
com.mojang.serialization.Codec
<String>
-
Field Details
-
property
The field for theproperty
record component. -
VALUE_CODEC
-
TYPE
-
-
Constructor Details
-
ItemBlockState
Creates an instance of aItemBlockState
record class.- Parameters:
property
- the value for theproperty
record component
-
-
Method Details
-
get
@Nullable public String get(ItemStack p_387708_, @Nullable ClientLevel p_388625_, @Nullable LivingEntity p_388880_, int p_388899_, ItemDisplayContext p_388088_) - Specified by:
get
in interfaceSelectItemModelProperty<String>
-
type
- Specified by:
type
in interfaceSelectItemModelProperty<String>
-
valueCodec
- Specified by:
valueCodec
in interfaceSelectItemModelProperty<String>
-
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
-