Record Class ShapedRecipe.Serializer.RawShapedRecipe

java.lang.Object
java.lang.Record
net.minecraft.world.item.crafting.ShapedRecipe.Serializer.RawShapedRecipe
Enclosing class:
ShapedRecipe.Serializer

static record ShapedRecipe.Serializer.RawShapedRecipe(String group, CraftingBookCategory category, Map<String,Ingredient> key, List<String> pattern, ItemStack result, boolean showNotification) extends Record
  • Field Details

    • group

      private final String group
      The field for the group record component.
    • category

      private final CraftingBookCategory category
      The field for the category record component.
    • key

      private final Map<String,Ingredient> key
      The field for the key record component.
    • pattern

      private final List<String> pattern
      The field for the pattern record component.
    • result

      private final ItemStack result
      The field for the result record component.
    • showNotification

      private final boolean showNotification
      The field for the showNotification record component.
    • CODEC

      public static final com.mojang.serialization.Codec<ShapedRecipe.Serializer.RawShapedRecipe> CODEC
  • Constructor Details

    • RawShapedRecipe

      RawShapedRecipe(String group, CraftingBookCategory category, Map<String,Ingredient> key, List<String> pattern, ItemStack result, boolean showNotification)
      Creates an instance of a RawShapedRecipe record class.
      Parameters:
      group - the value for the group record component
      category - the value for the category record component
      key - the value for the key record component
      pattern - the value for the pattern record component
      result - the value for the result record component
      showNotification - the value for the showNotification record component
  • Method Details

    • 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 '=='.
      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.
    • group

      public String group()
      Returns the value of the group record component.
      Returns:
      the value of the group record component
    • category

      public CraftingBookCategory category()
      Returns the value of the category record component.
      Returns:
      the value of the category record component
    • key

      public Map<String,Ingredient> key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component
    • pattern

      public List<String> pattern()
      Returns the value of the pattern record component.
      Returns:
      the value of the pattern record component
    • result

      public ItemStack result()
      Returns the value of the result record component.
      Returns:
      the value of the result record component
    • showNotification

      public boolean showNotification()
      Returns the value of the showNotification record component.
      Returns:
      the value of the showNotification record component