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.ItemContextprivate final ItemStackThe field for theheldItemTransformedTorecord component.(package private) static InteractionResult.ItemContextprivate final booleanThe field for thewasItemInteractionrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionItemContext(boolean wasItemInteraction, ItemStack heldItemTransformedTo) Creates an instance of aItemContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theheldItemTransformedTorecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of thewasItemInteractionrecord component.
-
Field Details
-
wasItemInteraction
private final boolean wasItemInteractionThe field for thewasItemInteractionrecord component. -
heldItemTransformedTo
The field for theheldItemTransformedTorecord component. -
NONE
-
DEFAULT
-
-
Constructor Details
-
ItemContext
Creates an instance of aItemContextrecord class.- Parameters:
wasItemInteraction- the value for thewasItemInteractionrecord componentheldItemTransformedTo- the value for theheldItemTransformedTorecord 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 thewasItemInteractionrecord component.- Returns:
- the value of the
wasItemInteractionrecord component
-
heldItemTransformedTo
Returns the value of theheldItemTransformedTorecord component.- Returns:
- the value of the
heldItemTransformedTorecord component
-