Enum Class PackFileType
- All Implemented Interfaces:
Serializable,Comparable<PackFileType>,Constable
Defines the different types of pack files that can be handled by openloader.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.server.packs.repository.Pack.ResourcesSuppliercreatePackSupplier(File packFile) Creates a resource supplier for the pack file.static PackFileTypeDetermines the type of the given pack candidate file.booleanDetermines if packs of this type should be loaded by openloader.typeName()Gets a displayable name for this type of pack file type.static PackFileTypeReturns the enum constant of this class with the specified name.static PackFileType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ARCHIVE
The file is a valid ZIP archive, such as a ZIP file or a JAR file. -
FOLDER
The file is a directory that contains a valid pack.mcmeta file. -
INVALID
The file can not be handled by OpenLoader.
-
-
Method Details
-
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
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 nameNullPointerException- 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
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
Determines the type of the given pack candidate file.- Parameters:
candidate- The file candidate to load.- Returns:
- The pack type of the file.
-