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 final InteractionResult.ItemContextprivate final @Nullable ItemStackThe field for theheldItemTransformedTorecord component.(package private) static final InteractionResult.ItemContextprivate final booleanThe field for thewasItemInteractionrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionItemContext(boolean wasItemInteraction, @Nullable 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.@Nullable ItemStackReturns 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
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
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
-