Package net.minecraft.resource
Class DefaultResourcePack
java.lang.Object
net.minecraft.resource.DefaultResourcePack
- All Implemented Interfaces:
AutoCloseable,ResourcePack
- Direct Known Subclasses:
DefaultClientResourcePack
public class DefaultResourcePack extends Object implements ResourcePack
-
Field Summary
Fields Modifier and Type Field Description PackResourceMetadatafield_26938private static LoggerLOGGERSet<String>namespacesstatic Class<?>resourceClassstatic PathresourcePathprivate static Map<ResourceType,FileSystem>typeToFileSystem -
Constructor Summary
Constructors Constructor Description DefaultResourcePack(PackResourceMetadata packResourceMetadata, String[] string) -
Method Summary
Modifier and Type Method Description voidclose()booleancontains(ResourceType type, Identifier id)protected InputStreamfindInputStream(ResourceType type, Identifier id)Collection<Identifier>findResources(ResourceType type, String namespace, String prefix, int maxDepth, Predicate<String> pathFilter)private static voidgetIdentifiers(Collection<Identifier> collection, int maxDepth, String namespace, Path path, String searchLocation, Predicate<String> predicate)protected InputStreamgetInputStream(String path)StringgetName()Set<String>getNamespaces(ResourceType type)private static StringgetPath(ResourceType type, Identifier id)private static booleanisValidUrl(String fileName, URL url)InputStreamopen(ResourceType type, Identifier id)InputStreamopenRoot(String fileName)<T> TparseMetadata(ResourceMetadataReader<T> metaReader)
-
Field Details
-
resourcePath
-
LOGGER
-
resourceClass
-
typeToFileSystem
-
field_26938
-
namespaces
-
-
Constructor Details
-
DefaultResourcePack
-
-
Method Details
-
openRoot
- Specified by:
openRootin interfaceResourcePack- Throws:
IOException
-
open
- Specified by:
openin interfaceResourcePack- Throws:
IOException
-
findResources
public Collection<Identifier> findResources(ResourceType type, String namespace, String prefix, int maxDepth, Predicate<String> pathFilter)- Specified by:
findResourcesin interfaceResourcePack
-
getIdentifiers
private static void getIdentifiers(Collection<Identifier> collection, int maxDepth, String namespace, Path path, String searchLocation, Predicate<String> predicate) -
findInputStream
-
getPath
-
isValidUrl
- Throws:
IOException
-
getInputStream
-
contains
- Specified by:
containsin interfaceResourcePack
-
getNamespaces
- Specified by:
getNamespacesin interfaceResourcePack
-
parseMetadata
- Specified by:
parseMetadatain interfaceResourcePack
-
getName
- Specified by:
getNamein interfaceResourcePack
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceResourcePack
-