Package net.minecraft.world
Record Class InteractionResult.ItemContext
java.lang.Object
java.lang.Record
net.minecraft.world.InteractionResult.ItemContext
- Enclosing interface:
InteractionResult
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static InteractionResult.ItemContext
private final ItemStack
The field for theheldItemTransformedTo
record component.(package private) static InteractionResult.ItemContext
private final boolean
The field for thewasItemInteraction
record component. -
Constructor Summary
ConstructorsConstructorDescriptionItemContext
(boolean wasItemInteraction, ItemStack heldItemTransformedTo) Creates an instance of aItemContext
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theheldItemTransformedTo
record component.final String
toString()
Returns a string representation of this record class.boolean
Returns the value of thewasItemInteraction
record component.
-
Field Details
-
wasItemInteraction
private final boolean wasItemInteractionThe field for thewasItemInteraction
record component. -
heldItemTransformedTo
The field for theheldItemTransformedTo
record component. -
NONE
-
DEFAULT
-
-
Constructor Details
-
ItemContext
Creates an instance of aItemContext
record class.- Parameters:
wasItemInteraction
- the value for thewasItemInteraction
record componentheldItemTransformedTo
- the value for theheldItemTransformedTo
record component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
wasItemInteraction
public boolean wasItemInteraction()Returns the value of thewasItemInteraction
record component.- Returns:
- the value of the
wasItemInteraction
record component
-
heldItemTransformedTo
Returns the value of theheldItemTransformedTo
record component.- Returns:
- the value of the
heldItemTransformedTo
record component
-