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
Modifier and TypeFieldDescriptionprivate final AdvancementHolder
The field for theadvancement
record component.private final ICondition
The field for thecondition
record component.private final int
The field for thecount
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<?>
The field for thetype
record component. -
Constructor Summary
ConstructorDescriptionResult
(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 aResult
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadvancement
record component.Returns the value of thecondition
record component.int
count()
Returns the value of thecount
record component.final boolean
Indicates whether some other object is "equal to" this one.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_126349_) final String
toString()
Returns a string representation of this record class.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
advancementData, serializeRecipe
-
Field Details
-
id
The field for theid
record component. -
type
The field for thetype
record component. -
group
The field for thegroup
record component. -
ingredient
The field for theingredient
record component. -
result
The field for theresult
record component. -
count
private final int countThe field for thecount
record component. -
advancement
The field for theadvancement
record component. -
condition
The field for thecondition
record 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 aResult
record class.- Parameters:
id
- the value for theid
record componenttype
- the value for thetype
record componentgroup
- the value for thegroup
record componentingredient
- the value for theingredient
record componentresult
- the value for theresult
record componentcount
- the value for thecount
record componentadvancement
- the value for theadvancement
record componentcondition
- the value for thecondition
record component
-
-
Method Details
-
serializeRecipeData
public void serializeRecipeData(com.google.gson.JsonObject p_126349_) - Specified by:
serializeRecipeData
in interfaceFinishedRecipe
-
id
Returns the value of theid
record component.- Specified by:
id
in interfaceFinishedRecipe
- Returns:
- the value of the
id
record component
-
type
Returns the value of thetype
record component.- Specified by:
type
in interfaceFinishedRecipe
- Returns:
- the value of the
type
record component
-
advancement
Returns the value of theadvancement
record component.- Specified by:
advancement
in interfaceFinishedRecipe
- Returns:
- the value of the
advancement
record 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 thegroup
record component.- Returns:
- the value of the
group
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
-
count
public int count()Returns the value of thecount
record component.- Returns:
- the value of the
count
record component
-
condition
Returns the value of thecondition
record component.- Returns:
- the value of the
condition
record component
-