Record Class ConditionalRecipe.Finished
java.lang.Object
java.lang.Record
net.minecraftforge.common.crafting.ConditionalRecipe.Finished
- All Implemented Interfaces:
FinishedRecipe
- Enclosing class:
- ConditionalRecipe
private static record ConditionalRecipe.Finished(ResourceLocation id, @Nullable ICondition mainCondition, List<ConditionalRecipe.RecipePair> recipes, ResourceLocation advId, com.google.gson.JsonObject advData)
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 com.google.gson.JsonObject
The field for theadvData
record component.private final ResourceLocation
The field for theadvId
record component.private final ResourceLocation
The field for theid
record component.private final @Nullable ICondition
The field for themainCondition
record component.private final List<ConditionalRecipe.RecipePair>
The field for therecipes
record component. -
Constructor Summary
ModifierConstructorDescriptionprivate
Finished
(ResourceLocation id, @Nullable ICondition mainCondition, List<ConditionalRecipe.RecipePair> recipes, ResourceLocation advId, com.google.gson.JsonObject advData) Creates an instance of aFinished
record class. -
Method Summary
Modifier and TypeMethodDescription@Nullable AdvancementHolder
@Nullable FinishedRecipe.AdvancementData
com.google.gson.JsonObject
advData()
Returns the value of theadvData
record component.advId()
Returns the value of theadvId
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.id()
Returns the value of theid
record component.@Nullable ICondition
Returns the value of themainCondition
record component.recipes()
Returns the value of therecipes
record component.void
serializeRecipeData
(com.google.gson.JsonObject json) final String
toString()
Returns a string representation of this record class.type()
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. -
mainCondition
The field for themainCondition
record component. -
recipes
The field for therecipes
record component. -
advId
The field for theadvId
record component. -
advData
private final com.google.gson.JsonObject advDataThe field for theadvData
record component.
-
-
Constructor Details
-
Finished
private Finished(ResourceLocation id, @Nullable @Nullable ICondition mainCondition, List<ConditionalRecipe.RecipePair> recipes, ResourceLocation advId, com.google.gson.JsonObject advData) Creates an instance of aFinished
record class.- Parameters:
id
- the value for theid
record componentmainCondition
- the value for themainCondition
record componentrecipes
- the value for therecipes
record componentadvId
- the value for theadvId
record componentadvData
- the value for theadvData
record component
-
-
Method Details
-
serializeRecipeData
public void serializeRecipeData(com.google.gson.JsonObject json) - 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
- Specified by:
type
in interfaceFinishedRecipe
-
advancement
- Specified by:
advancement
in interfaceFinishedRecipe
-
advancementData
- Specified by:
advancementData
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
mainCondition
Returns the value of themainCondition
record component.- Returns:
- the value of the
mainCondition
record component
-
recipes
Returns the value of therecipes
record component.- Returns:
- the value of the
recipes
record component
-
advId
Returns the value of theadvId
record component.- Returns:
- the value of the
advId
record component
-
advData
public com.google.gson.JsonObject advData()Returns the value of theadvData
record component.- Returns:
- the value of the
advData
record component
-