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
  • Field Details

    • id

      private final ResourceLocation id
      The field for the id record component.
    • mainCondition

      @Nullable private final @Nullable ICondition mainCondition
      The field for the mainCondition record component.
    • recipes

      private final List<ConditionalRecipe.RecipePair> recipes
      The field for the recipes record component.
    • advId

      private final ResourceLocation advId
      The field for the advId record component.
    • advData

      private final com.google.gson.JsonObject advData
      The field for the advData 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 a Finished record class.
      Parameters:
      id - the value for the id record component
      mainCondition - the value for the mainCondition record component
      recipes - the value for the recipes record component
      advId - the value for the advId record component
      advData - the value for the advData record component
  • Method Details

    • serializeRecipeData

      public void serializeRecipeData(com.google.gson.JsonObject json)
      Specified by:
      serializeRecipeData in interface FinishedRecipe
    • id

      public ResourceLocation id()
      Returns the value of the id record component.
      Specified by:
      id in interface FinishedRecipe
      Returns:
      the value of the id record component
    • type

      public RecipeSerializer<?> type()
      Specified by:
      type in interface FinishedRecipe
    • advancement

      @Nullable public @Nullable AdvancementHolder advancement()
      Specified by:
      advancement in interface FinishedRecipe
    • advancementData

      @Nullable public @Nullable FinishedRecipe.AdvancementData advancementData()
      Specified by:
      advancementData in interface FinishedRecipe
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • mainCondition

      @Nullable public @Nullable ICondition mainCondition()
      Returns the value of the mainCondition record component.
      Returns:
      the value of the mainCondition record component
    • recipes

      Returns the value of the recipes record component.
      Returns:
      the value of the recipes record component
    • advId

      public ResourceLocation advId()
      Returns the value of the advId record component.
      Returns:
      the value of the advId record component
    • advData

      public com.google.gson.JsonObject advData()
      Returns the value of the advData record component.
      Returns:
      the value of the advData record component