Record Class KnownPack

java.lang.Object
java.lang.Record
net.minecraft.server.packs.repository.KnownPack

public record KnownPack(String namespace, String id, String version) extends Record
  • Field Details

    • namespace

      private final String namespace
      The field for the namespace record component.
    • id

      private final String id
      The field for the id record component.
    • version

      private final String version
      The field for the version record component.
    • STREAM_CODEC

      public static final StreamCodec<io.netty.buffer.ByteBuf,KnownPack> STREAM_CODEC
    • VANILLA_NAMESPACE

      public static final String VANILLA_NAMESPACE
      See Also:
  • Constructor Details

    • KnownPack

      public KnownPack(String namespace, String id, String version)
      Creates an instance of a KnownPack record class.
      Parameters:
      namespace - the value for the namespace record component
      id - the value for the id record component
      version - the value for the version record component
  • Method Details

    • vanilla

      public static KnownPack vanilla(String p_326036_)
    • isVanilla

      public boolean isVanilla()
    • toString

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

      public String namespace()
      Returns the value of the namespace record component.
      Returns:
      the value of the namespace record component
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • version

      public String version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component