Record Class IngredientWithAmount
java.lang.Object
java.lang.Record
com.blamejared.crafttweaker.api.ingredient.type.IngredientWithAmount
- All Implemented Interfaces:
CommandStringDisplayable,IIngredientWithAmount
@ZenRegister
public record IngredientWithAmount(IIngredient ingredient, int amount)
extends Record
implements IIngredientWithAmount
-
Constructor Summary
ConstructorsConstructorDescriptionIngredientWithAmount(IIngredient ingredient, int amount) Creates an instance of aIngredientWithAmountrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintamount()Returns the value of theamountrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the BEP to get this thingyfinal inthashCode()Returns a hash code value for this object.Returns the value of theingredientrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.blamejared.crafttweaker.api.ingredient.IIngredientWithAmount
asIData
-
Constructor Details
-
IngredientWithAmount
Creates an instance of aIngredientWithAmountrecord class.- Parameters:
ingredient- the value for theingredientrecord componentamount- the value for theamountrecord component
-
-
Method Details
-
getCommandString
Description copied from interface:CommandStringDisplayableReturns the BEP to get this thingy- Specified by:
getCommandStringin interfaceCommandStringDisplayable
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
ingredient
Returns the value of theingredientrecord component.- Specified by:
ingredientin interfaceIIngredientWithAmount- Returns:
- the value of the
ingredientrecord component
-
amount
public int amount()Returns the value of theamountrecord component.- Specified by:
amountin interfaceIIngredientWithAmount- Returns:
- the value of the
amountrecord component
-