Record Class CapItemVariantItem
java.lang.Object
java.lang.Record
at.petrak.hexcasting.forge.cap.adimpl.CapItemVariantItem
- All Implemented Interfaces:
at.petrak.hexcasting.api.addldata.ADVariantItem
public record CapItemVariantItem(at.petrak.hexcasting.api.item.VariantItem variantItem, net.minecraft.world.item.ItemStack stack)
extends Record
implements at.petrak.hexcasting.api.addldata.ADVariantItem
-
Constructor Summary
ConstructorsConstructorDescriptionCapItemVariantItem(at.petrak.hexcasting.api.item.VariantItem variantItem, net.minecraft.world.item.ItemStack stack) Creates an instance of aCapItemVariantItemrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intfinal inthashCode()Returns a hash code value for this object.intvoidsetVariant(int variant) net.minecraft.world.item.ItemStackstack()Returns the value of thestackrecord component.final StringtoString()Returns a string representation of this record class.at.petrak.hexcasting.api.item.VariantItemReturns the value of thevariantItemrecord component.
-
Constructor Details
-
CapItemVariantItem
public CapItemVariantItem(at.petrak.hexcasting.api.item.VariantItem variantItem, net.minecraft.world.item.ItemStack stack) Creates an instance of aCapItemVariantItemrecord class.- Parameters:
variantItem- the value for thevariantItemrecord componentstack- the value for thestackrecord component
-
-
Method Details
-
numVariants
public int numVariants()- Specified by:
numVariantsin interfaceat.petrak.hexcasting.api.addldata.ADVariantItem
-
getVariant
public int getVariant()- Specified by:
getVariantin interfaceat.petrak.hexcasting.api.addldata.ADVariantItem
-
setVariant
public void setVariant(int variant) - Specified by:
setVariantin interfaceat.petrak.hexcasting.api.addldata.ADVariantItem
-
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). -
variantItem
public at.petrak.hexcasting.api.item.VariantItem variantItem()Returns the value of thevariantItemrecord component.- Returns:
- the value of the
variantItemrecord component
-
stack
public net.minecraft.world.item.ItemStack stack()Returns the value of thestackrecord component.- Returns:
- the value of the
stackrecord component
-