Record Class LocalRecipeData

java.lang.Object
java.lang.Record
com.example.uselocalrecipes.recipe.LocalRecipeData

public record LocalRecipeData(net.minecraft.world.item.crafting.RecipeMap recipes, int fileCount, int failedCount, List<net.minecraft.core.Registry.PendingTags<?>> pendingTags) extends Record
Result of reading the recipes that are available on the client machine.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final LocalRecipeData
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    LocalRecipeData(net.minecraft.world.item.crafting.RecipeMap recipes, int fileCount, int failedCount, List<net.minecraft.core.Registry.PendingTags<?>> pendingTags)
    Creates an instance of a LocalRecipeData record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Must run on the client thread before the recipes reach the viewers, otherwise tag based ingredients fail.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the failedCount record component.
    int
    Returns the value of the fileCount record component.
    final int
    Returns a hash code value for this object.
    List<net.minecraft.core.Registry.PendingTags<?>>
    Returns the value of the pendingTags record component.
    net.minecraft.world.item.crafting.RecipeMap
    Returns the value of the recipes record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • LocalRecipeData

      public LocalRecipeData(net.minecraft.world.item.crafting.RecipeMap recipes, int fileCount, int failedCount, List<net.minecraft.core.Registry.PendingTags<?>> pendingTags)
      Creates an instance of a LocalRecipeData record class.
      Parameters:
      recipes - the value for the recipes record component
      fileCount - the value for the fileCount record component
      failedCount - the value for the failedCount record component
      pendingTags - the value for the pendingTags record component
  • Method Details

    • applyPendingTags

      public void applyPendingTags()
      Must run on the client thread before the recipes reach the viewers, otherwise tag based ingredients fail.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • recipes

      public net.minecraft.world.item.crafting.RecipeMap recipes()
      Returns the value of the recipes record component.
      Returns:
      the value of the recipes record component
    • fileCount

      public int fileCount()
      Returns the value of the fileCount record component.
      Returns:
      the value of the fileCount record component
    • failedCount

      public int failedCount()
      Returns the value of the failedCount record component.
      Returns:
      the value of the failedCount record component
    • pendingTags

      public List<net.minecraft.core.Registry.PendingTags<?>> pendingTags()
      Returns the value of the pendingTags record component.
      Returns:
      the value of the pendingTags record component