Record Class IntersectionIngredient.IntersectionValue
java.lang.Object
java.lang.Record
net.neoforged.neoforge.common.crafting.IntersectionIngredient.IntersectionValue
- All Implemented Interfaces:
Ingredient.Value
- Enclosing class:
- IntersectionIngredient
public static record IntersectionIngredient.IntersectionValue(Ingredient.Value inner, List<Ingredient> other)
extends Record
implements Ingredient.Value
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Ingredient.Value
The field for theinner
record component.private final List<Ingredient>
The field for theother
record component.Fields inherited from interface net.minecraft.world.item.crafting.Ingredient.Value
CODEC
-
Constructor Summary
ConstructorsConstructorDescriptionIntersectionValue
(Ingredient.Value inner, List<Ingredient> other) Creates an instance of aIntersectionValue
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.other()
Returns the value of theother
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
inner
The field for theinner
record component. -
other
The field for theother
record component.
-
-
Constructor Details
-
IntersectionValue
Creates an instance of aIntersectionValue
record class.- Parameters:
inner
- the value for theinner
record componentother
- the value for theother
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
-
other
Returns the value of theother
record component.- Returns:
- the value of the
other
record component
-