Record Class IsKeybindDown
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.item.properties.conditional.IsKeybindDown
- All Implemented Interfaces:
ConditionalItemModelProperty
,ItemModelPropertyTest
public record IsKeybindDown(KeyMapping keybind)
extends Record
implements ConditionalItemModelProperty
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final KeyMapping
The field for thekeybind
record component.private static final com.mojang.serialization.Codec
<KeyMapping> static final com.mojang.serialization.MapCodec
<IsKeybindDown> -
Constructor Summary
ConstructorsConstructorDescriptionIsKeybindDown
(KeyMapping keybind) Creates an instance of aIsKeybindDown
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.boolean
get
(ItemStack p_389550_, ClientLevel p_389440_, LivingEntity p_389703_, int p_389439_, ItemDisplayContext p_389599_) final int
hashCode()
Returns a hash code value for this object.keybind()
Returns the value of thekeybind
record component.final String
toString()
Returns a string representation of this record class.com.mojang.serialization.MapCodec
<IsKeybindDown> type()
-
Field Details
-
keybind
The field for thekeybind
record component. -
KEYBIND_CODEC
-
MAP_CODEC
-
-
Constructor Details
-
IsKeybindDown
Creates an instance of aIsKeybindDown
record class.- Parameters:
keybind
- the value for thekeybind
record component
-
-
Method Details
-
get
public boolean get(ItemStack p_389550_, @Nullable ClientLevel p_389440_, @Nullable LivingEntity p_389703_, int p_389439_, ItemDisplayContext p_389599_) - Specified by:
get
in interfaceItemModelPropertyTest
-
type
- Specified by:
type
in interfaceConditionalItemModelProperty
-
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)
. -
keybind
Returns the value of thekeybind
record component.- Returns:
- the value of the
keybind
record component
-