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