Record Class CastingEnvironment.HeldItemInfo
java.lang.Object
java.lang.Record
at.petrak.hexcasting.api.casting.eval.CastingEnvironment.HeldItemInfo
- Enclosing class:
- CastingEnvironment
public static record CastingEnvironment.HeldItemInfo(net.minecraft.world.item.ItemStack stack, @Nullable net.minecraft.world.InteractionHand hand)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionHeldItemInfo(net.minecraft.world.item.ItemStack stack, @Nullable net.minecraft.world.InteractionHand hand) Creates an instance of aHeldItemInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.ItemStack@Nullable net.minecraft.world.InteractionHandfinal booleanIndicates whether some other object is "equal to" this one.@Nullable net.minecraft.world.InteractionHandhand()Returns the value of thehandrecord component.final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.ItemStackstack()Returns the value of thestackrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
HeldItemInfo
public HeldItemInfo(net.minecraft.world.item.ItemStack stack, @Nullable @Nullable net.minecraft.world.InteractionHand hand) Creates an instance of aHeldItemInforecord class.- Parameters:
stack- the value for thestackrecord componenthand- the value for thehandrecord component
-
-
Method Details
-
component1
public net.minecraft.world.item.ItemStack component1() -
component2
@Nullable public @Nullable net.minecraft.world.InteractionHand component2() -
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). -
stack
public net.minecraft.world.item.ItemStack stack()Returns the value of thestackrecord component.- Returns:
- the value of the
stackrecord component
-
hand
@Nullable public @Nullable net.minecraft.world.InteractionHand hand()Returns the value of thehandrecord component.- Returns:
- the value of the
handrecord component
-