Record Class Ingredient.ItemValue
java.lang.Object
java.lang.Record
net.minecraft.world.item.crafting.Ingredient.ItemValue
- All Implemented Interfaces:
- Ingredient.Value
- Enclosing class:
- Ingredient
public static record Ingredient.ItemValue(ItemStack item)
extends Record
implements Ingredient.Value
- 
Field SummaryFieldsModifier and TypeFieldDescription(package private) static final com.mojang.serialization.Codec<Ingredient.ItemValue>private final ItemStackThe field for theitemrecord component.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.getItems()final inthashCode()Returns a hash code value for this object.item()Returns the value of theitemrecord component.final StringtoString()Returns a string representation of this record class.
- 
Field Details- 
itemThe field for theitemrecord component.
- 
CODEC
 
- 
- 
Constructor Details- 
ItemValueCreates an instance of aItemValuerecord class.- Parameters:
- item- the value for the- itemrecord component
 
 
- 
- 
Method Details- 
equalsIndicates 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).
- 
getItems- Specified by:
- getItemsin interface- Ingredient.Value
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
itemReturns the value of theitemrecord component.- Returns:
- the value of the itemrecord component
 
 
-