Record Class CompoundIngredient.Value
java.lang.Object
java.lang.Record
net.neoforged.neoforge.common.crafting.CompoundIngredient.Value
- All Implemented Interfaces:
Ingredient.Value
- Enclosing class:
- CompoundIngredient
private static record CompoundIngredient.Value(Ingredient inner)
extends Record
implements Ingredient.Value
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Ingredient
The field for theinner
record component.Fields inherited from interface net.minecraft.world.item.crafting.Ingredient.Value
CODEC
-
Constructor Summary
ModifierConstructorDescriptionprivate
Value
(Ingredient inner) Creates an instance of aValue
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.getItems()
final int
hashCode()
Returns a hash code value for this object.inner()
Returns the value of theinner
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
inner
The field for theinner
record component.
-
-
Constructor Details
-
Value
Creates an instance of aValue
record class.- Parameters:
inner
- the value for theinner
record component
-
-
Method Details
-
getItems
- Specified by:
getItems
in interfaceIngredient.Value
-
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)
. -
inner
Returns the value of theinner
record component.- Returns:
- the value of the
inner
record component
-