Record Class PackContentType

java.lang.Object
java.lang.Record
net.darkhax.openloader.common.impl.packs.PackContentType
Record Components:
data - If the pack contains data.
resources - If the pack contains data.

public record PackContentType(boolean data, boolean resources) extends Record
Determines the type of contents held by a given pack. A pack may contain data, resources, both, or neither.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PackContentType(boolean data, boolean resources)
    Creates an instance of a PackContentType record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the data record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    from(Path filePath)
    Determines the content types of a given file.
    final int
    Returns a hash code value for this object.
    boolean
    isFor(net.minecraft.server.packs.PackType type)
    Checks if the pack contains content for a given pack type.
    boolean
    Returns the value of the resources record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • PackContentType

      public PackContentType(boolean data, boolean resources)
      Creates an instance of a PackContentType record class.
      Parameters:
      data - the value for the data record component
      resources - the value for the resources record component
  • Method Details

    • isFor

      public boolean isFor(net.minecraft.server.packs.PackType type)
      Checks if the pack contains content for a given pack type. For example if the pack contains resource pack files, or data pack files.
      Parameters:
      type - The pack type to check for.
      Returns:
      If the pack contains contents for the given pack type.
    • from

      public static PackContentType from(Path filePath)
      Determines the content types of a given file.
      Parameters:
      filePath - The path to the pack file.
      Returns:
      The content types of the pack.
    • 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 '=='.
      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.
    • data

      public boolean data()
      Returns the value of the data record component.
      Returns:
      the value of the data record component
    • resources

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