Enum Class PackFileType

java.lang.Object
java.lang.Enum<PackFileType>
net.darkhax.openloader.common.impl.packs.PackFileType
All Implemented Interfaces:
Serializable, Comparable<PackFileType>, Constable

public enum PackFileType extends Enum<PackFileType>
Defines the different types of pack files that can be handled by openloader.
  • Enum Constant Details

    • ARCHIVE

      public static final PackFileType ARCHIVE
      The file is a valid ZIP archive, such as a ZIP file or a JAR file.
    • FOLDER

      public static final PackFileType FOLDER
      The file is a directory that contains a valid pack.mcmeta file.
    • INVALID

      public static final PackFileType INVALID
      The file can not be handled by OpenLoader.
  • Method Details

    • values

      public static PackFileType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PackFileType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isLoadable

      public boolean isLoadable()
      Determines if packs of this type should be loaded by openloader.
      Returns:
      If OpenLoader can load this type of pack file.
    • typeName

      public String typeName()
      Gets a displayable name for this type of pack file type.
      Returns:
      The displayable name of the pack file type.
    • createPackSupplier

      public net.minecraft.server.packs.repository.Pack.ResourcesSupplier createPackSupplier(File packFile)
      Creates a resource supplier for the pack file. This differs between the different type of files, for example compressed archives vs directories.
      Parameters:
      packFile - The file to create a resource supplier for.
      Returns:
      The resource supplier for the pack type.
    • from

      public static PackFileType from(File candidate)
      Determines the type of the given pack candidate file.
      Parameters:
      candidate - The file candidate to load.
      Returns:
      The pack type of the file.