Record Class Ingredient.TagEntry

java.lang.Object
java.lang.Record
net.minecraft.recipe.Ingredient.TagEntry
Record Components:
tag -
All Implemented Interfaces:
Ingredient.Entry
Enclosing class:
Ingredient

private static record Ingredient.TagEntry(TagKey<Item> tag) extends Record implements Ingredient.Entry
Mappings:
Namespace Name
official cpz$b
intermediary net/minecraft/class_1856$class_1858
named net/minecraft/recipe/Ingredient$TagEntry
official b
intermediary comp_1931
named tag
  • Field Details

    • tag

      private final TagKey<Item> tag
      The field for the tag record component.
    • CODEC

      static final com.mojang.serialization.Codec<Ingredient.TagEntry> CODEC
      Mappings:
      Namespace Name Mixin selector
      official c Lcpz$b;c:Lcom/mojang/serialization/Codec;
      intermediary field_46098 Lnet/minecraft/class_1856$class_1858;field_46098:Lcom/mojang/serialization/Codec;
      named CODEC Lnet/minecraft/recipe/Ingredient$TagEntry;CODEC:Lcom/mojang/serialization/Codec;
  • Constructor Details

    • TagEntry

      TagEntry(TagKey<Item> tag)
      Creates an instance of a TagEntry record class.
      Parameters:
      tag - the value for the tag record component
  • Method Details

    • equals

      public 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.
    • getStacks

      public Collection<ItemStack> getStacks()
      Specified by:
      getStacks in interface Ingredient.Entry
      Mappings:
      Namespace Name Mixin selector
      official a Lcpz$c;a()Ljava/util/Collection;
      intermediary method_8108 Lnet/minecraft/class_1856$class_1859;method_8108()Ljava/util/Collection;
      named getStacks Lnet/minecraft/recipe/Ingredient$Entry;getStacks()Ljava/util/Collection;
    • 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
    • tag

      public TagKey<Item> tag()
      Returns the value of the tag record component.
      Returns:
      the value of the tag record component