Package net.minecraft.data.recipes
Record Class SingleItemRecipeBuilder.Result
java.lang.Object
java.lang.Record
net.minecraft.data.recipes.SingleItemRecipeBuilder.Result
- All Implemented Interfaces:
FinishedRecipe
- Enclosing class:
- SingleItemRecipeBuilder
public static record SingleItemRecipeBuilder.Result(ResourceLocation id, RecipeSerializer<?> type, String group, Ingredient ingredient, Item result, int count, AdvancementHolder advancement, ICondition condition)
extends Record
implements FinishedRecipe
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.data.recipes.FinishedRecipe
FinishedRecipe.AdvancementData -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AdvancementHolderThe field for theadvancementrecord component.private final IConditionThe field for theconditionrecord component.private final intThe field for thecountrecord component.private final StringThe field for thegrouprecord component.private final ResourceLocationThe field for theidrecord component.private final IngredientThe field for theingredientrecord component.private final ItemThe field for theresultrecord component.private final RecipeSerializer<?>The field for thetyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionResult(ResourceLocation id, RecipeSerializer<?> type, String group, Ingredient ingredient, Item result, int count, AdvancementHolder advancement) Result(ResourceLocation id, RecipeSerializer<?> type, String group, Ingredient ingredient, Item result, int count, AdvancementHolder advancement, ICondition condition) Creates an instance of aResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadvancementrecord component.Returns the value of theconditionrecord component.intcount()Returns the value of thecountrecord component.final booleanIndicates whether some other object is "equal to" this one.group()Returns the value of thegrouprecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of theingredientrecord component.result()Returns the value of theresultrecord component.voidserializeRecipeData(com.google.gson.JsonObject p_126349_) final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.data.recipes.FinishedRecipe
advancementData, serializeRecipe
-
Field Details
-
id
The field for theidrecord component. -
type
The field for thetyperecord component. -
group
The field for thegrouprecord component. -
ingredient
The field for theingredientrecord component. -
result
The field for theresultrecord component. -
count
private final int countThe field for thecountrecord component. -
advancement
The field for theadvancementrecord component. -
condition
The field for theconditionrecord component.
-
-
Constructor Details
-
Result
Result(ResourceLocation id, RecipeSerializer<?> type, String group, Ingredient ingredient, Item result, int count, AdvancementHolder advancement) -
Result
public Result(ResourceLocation id, RecipeSerializer<?> type, String group, Ingredient ingredient, Item result, int count, AdvancementHolder advancement, ICondition condition) Creates an instance of aResultrecord class.- Parameters:
id- the value for theidrecord componenttype- the value for thetyperecord componentgroup- the value for thegrouprecord componentingredient- the value for theingredientrecord componentresult- the value for theresultrecord componentcount- the value for thecountrecord componentadvancement- the value for theadvancementrecord componentcondition- the value for theconditionrecord component
-
-
Method Details
-
serializeRecipeData
public void serializeRecipeData(com.google.gson.JsonObject p_126349_) - Specified by:
serializeRecipeDatain interfaceFinishedRecipe
-
id
Returns the value of theidrecord component.- Specified by:
idin interfaceFinishedRecipe- Returns:
- the value of the
idrecord component
-
type
Returns the value of thetyperecord component.- Specified by:
typein interfaceFinishedRecipe- Returns:
- the value of the
typerecord component
-
advancement
Returns the value of theadvancementrecord component.- Specified by:
advancementin interfaceFinishedRecipe- Returns:
- the value of the
advancementrecord component
-
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 '=='. -
group
Returns the value of thegrouprecord component.- Returns:
- the value of the
grouprecord component
-
ingredient
Returns the value of theingredientrecord component.- Returns:
- the value of the
ingredientrecord component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
count
public int count()Returns the value of thecountrecord component.- Returns:
- the value of the
countrecord component
-
condition
Returns the value of theconditionrecord component.- Returns:
- the value of the
conditionrecord component
-