Package net.minecraft.data.recipes
Record Class SimpleCookingRecipeBuilder.Result
java.lang.Object
java.lang.Record
net.minecraft.data.recipes.SimpleCookingRecipeBuilder.Result
- All Implemented Interfaces:
FinishedRecipe
- Enclosing class:
SimpleCookingRecipeBuilder
static record SimpleCookingRecipeBuilder.Result(ResourceLocation id, String group, CookingBookCategory category, Ingredient ingredient, Item result, float experience, int cookingTime, AdvancementHolder advancement, RecipeSerializer<? extends AbstractCookingRecipe> type)
extends Record
implements FinishedRecipe
-
Field Summary
Modifier and TypeFieldDescriptionprivate final AdvancementHolder
The field for theadvancement
record component.private final CookingBookCategory
The field for thecategory
record component.private final int
The field for thecookingTime
record component.private final float
The field for theexperience
record component.private final String
The field for thegroup
record component.private final ResourceLocation
The field for theid
record component.private final Ingredient
The field for theingredient
record component.private final Item
The field for theresult
record component.private final RecipeSerializer<? extends AbstractCookingRecipe>
The field for thetype
record component. -
Constructor Summary
ConstructorDescriptionResult
(ResourceLocation id, String group, CookingBookCategory category, Ingredient ingredient, Item result, float experience, int cookingTime, AdvancementHolder advancement, RecipeSerializer<? extends AbstractCookingRecipe> type) Creates an instance of aResult
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadvancement
record component.category()
Returns the value of thecategory
record component.int
Returns the value of thecookingTime
record component.final boolean
Indicates whether some other object is "equal to" this one.float
Returns the value of theexperience
record component.group()
Returns the value of thegroup
record component.final int
hashCode()
Returns a hash code value for this object.id()
Returns the value of theid
record component.Returns the value of theingredient
record component.result()
Returns the value of theresult
record component.void
serializeRecipeData
(com.google.gson.JsonObject p_126297_) final String
toString()
Returns a string representation of this record class.RecipeSerializer<? extends AbstractCookingRecipe>
type()
Returns the value of thetype
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.data.recipes.FinishedRecipe
serializeRecipe
-
Field Details
-
id
The field for theid
record component. -
group
The field for thegroup
record component. -
category
The field for thecategory
record component. -
ingredient
The field for theingredient
record component. -
result
The field for theresult
record component. -
experience
private final float experienceThe field for theexperience
record component. -
cookingTime
private final int cookingTimeThe field for thecookingTime
record component. -
advancement
The field for theadvancement
record component. -
type
The field for thetype
record component.
-
-
Constructor Details
-
Result
Result(ResourceLocation id, String group, CookingBookCategory category, Ingredient ingredient, Item result, float experience, int cookingTime, AdvancementHolder advancement, RecipeSerializer<? extends AbstractCookingRecipe> type) Creates an instance of aResult
record class.- Parameters:
id
- the value for theid
record componentgroup
- the value for thegroup
record componentcategory
- the value for thecategory
record componentingredient
- the value for theingredient
record componentresult
- the value for theresult
record componentexperience
- the value for theexperience
record componentcookingTime
- the value for thecookingTime
record componentadvancement
- the value for theadvancement
record componenttype
- the value for thetype
record component
-
-
Method Details
-
serializeRecipeData
public void serializeRecipeData(com.google.gson.JsonObject p_126297_) - Specified by:
serializeRecipeData
in interfaceFinishedRecipe
-
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 '=='. -
id
Returns the value of theid
record component.- Specified by:
id
in interfaceFinishedRecipe
- Returns:
- the value of the
id
record component
-
group
Returns the value of thegroup
record component.- Returns:
- the value of the
group
record component
-
category
Returns the value of thecategory
record component.- Returns:
- the value of the
category
record component
-
ingredient
Returns the value of theingredient
record component.- Returns:
- the value of the
ingredient
record component
-
result
Returns the value of theresult
record component.- Returns:
- the value of the
result
record component
-
experience
public float experience()Returns the value of theexperience
record component.- Returns:
- the value of the
experience
record component
-
cookingTime
public int cookingTime()Returns the value of thecookingTime
record component.- Returns:
- the value of the
cookingTime
record component
-
advancement
Returns the value of theadvancement
record component.- Specified by:
advancement
in interfaceFinishedRecipe
- Returns:
- the value of the
advancement
record component
-
type
Returns the value of thetype
record component.- Specified by:
type
in interfaceFinishedRecipe
- Returns:
- the value of the
type
record component
-