Record Class SmithingTrimRecipeBuilder.Result

java.lang.Object
java.lang.Record
net.minecraft.data.recipes.SmithingTrimRecipeBuilder.Result
All Implemented Interfaces:
FinishedRecipe
Enclosing class:
SmithingTrimRecipeBuilder

public static record SmithingTrimRecipeBuilder.Result(ResourceLocation id, RecipeSerializer<?> type, Ingredient template, Ingredient base, Ingredient addition, Advancement.Builder advancement, ResourceLocation advancementId) extends Record implements FinishedRecipe
  • Field Details

    • id

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

      private final RecipeSerializer<?> type
      The field for the type record component.
    • template

      private final Ingredient template
      The field for the template record component.
    • base

      private final Ingredient base
      The field for the base record component.
    • addition

      private final Ingredient addition
      The field for the addition record component.
    • advancement

      private final Advancement.Builder advancement
      The field for the advancement record component.
    • advancementId

      private final ResourceLocation advancementId
      The field for the advancementId record component.
  • Constructor Details

    • Result

      public Result(ResourceLocation id, RecipeSerializer<?> type, Ingredient template, Ingredient base, Ingredient addition, Advancement.Builder advancement, ResourceLocation advancementId)
      Creates an instance of a Result record class.
      Parameters:
      id - the value for the id record component
      type - the value for the type record component
      template - the value for the template record component
      base - the value for the base record component
      addition - the value for the addition record component
      advancement - the value for the advancement record component
      advancementId - the value for the advancementId record component
  • Method Details

    • serializeRecipeData

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

      public ResourceLocation getId()
      Specified by:
      getId in interface FinishedRecipe
    • getType

      public RecipeSerializer<?> getType()
      Specified by:
      getType in interface FinishedRecipe
    • serializeAdvancement

      @Nullable public com.google.gson.JsonObject serializeAdvancement()
      Specified by:
      serializeAdvancement in interface FinishedRecipe
    • getAdvancementId

      @Nullable public ResourceLocation getAdvancementId()
      Specified by:
      getAdvancementId 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.
    • id

      public ResourceLocation id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • type

      public RecipeSerializer<?> type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • template

      public Ingredient template()
      Returns the value of the template record component.
      Returns:
      the value of the template record component
    • base

      public Ingredient base()
      Returns the value of the base record component.
      Returns:
      the value of the base record component
    • addition

      public Ingredient addition()
      Returns the value of the addition record component.
      Returns:
      the value of the addition record component
    • advancement

      public Advancement.Builder advancement()
      Returns the value of the advancement record component.
      Returns:
      the value of the advancement record component
    • advancementId

      public ResourceLocation advancementId()
      Returns the value of the advancementId record component.
      Returns:
      the value of the advancementId record component