public class VanillaPack extends java.lang.Object implements IResourcePack
| Modifier and Type | Field and Description |
|---|---|
static java.lang.Class<?> |
baseClass |
static java.nio.file.Path |
basePath |
private static java.util.Map<ResourcePackType,java.nio.file.FileSystem> |
FILE_SYSTEMS_BY_PACK_TYPE |
private static org.apache.logging.log4j.Logger |
LOGGER |
java.util.Set<java.lang.String> |
resourceNamespaces |
| Constructor and Description |
|---|
VanillaPack(java.lang.String... resourceNamespacesIn) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
private static void |
collectResources(java.util.Collection<ResourceLocation> resourceLocationsIn,
int maxDepthIn,
java.lang.String namespaceIn,
java.nio.file.Path pathIn,
java.lang.String pathNameIn,
java.util.function.Predicate<java.lang.String> filterIn) |
java.util.Collection<ResourceLocation> |
getAllResourceLocations(ResourcePackType type,
java.lang.String namespaceIn,
java.lang.String pathIn,
int maxDepthIn,
java.util.function.Predicate<java.lang.String> filterIn) |
private java.io.InputStream |
getExtraInputStream(ResourcePackType type,
java.lang.String resource) |
protected java.io.InputStream |
getInputStreamVanilla(ResourcePackType type,
ResourceLocation location) |
protected java.io.InputStream |
getInputStreamVanilla(java.lang.String pathIn) |
<T> T |
getMetadata(IMetadataSectionSerializer<T> deserializer) |
java.lang.String |
getName() |
private static java.lang.String |
getPath(ResourcePackType packTypeIn,
ResourceLocation locationIn) |
java.util.Set<java.lang.String> |
getResourceNamespaces(ResourcePackType type) |
java.io.InputStream |
getResourceStream(ResourcePackType type,
ResourceLocation location) |
java.io.InputStream |
getRootResourceStream(java.lang.String fileName) |
private static boolean |
isValid(java.lang.String pathIn,
java.net.URL urlIn) |
boolean |
resourceExists(ResourcePackType type,
ResourceLocation location) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisHiddenpublic static java.nio.file.Path basePath
private static final org.apache.logging.log4j.Logger LOGGER
public static java.lang.Class<?> baseClass
private static final java.util.Map<ResourcePackType,java.nio.file.FileSystem> FILE_SYSTEMS_BY_PACK_TYPE
public final java.util.Set<java.lang.String> resourceNamespaces
public java.io.InputStream getRootResourceStream(java.lang.String fileName)
throws java.io.IOException
getRootResourceStream in interface IResourcePackjava.io.IOExceptionpublic java.io.InputStream getResourceStream(ResourcePackType type, ResourceLocation location) throws java.io.IOException
getResourceStream in interface IResourcePackjava.io.IOExceptionpublic java.util.Collection<ResourceLocation> getAllResourceLocations(ResourcePackType type, java.lang.String namespaceIn, java.lang.String pathIn, int maxDepthIn, java.util.function.Predicate<java.lang.String> filterIn)
getAllResourceLocations in interface IResourcePackprivate static void collectResources(java.util.Collection<ResourceLocation> resourceLocationsIn, int maxDepthIn, java.lang.String namespaceIn, java.nio.file.Path pathIn, java.lang.String pathNameIn, java.util.function.Predicate<java.lang.String> filterIn) throws java.io.IOException
java.io.IOException@Nullable protected java.io.InputStream getInputStreamVanilla(ResourcePackType type, ResourceLocation location)
private static java.lang.String getPath(ResourcePackType packTypeIn, ResourceLocation locationIn)
private static boolean isValid(java.lang.String pathIn,
@Nullable
java.net.URL urlIn)
throws java.io.IOException
java.io.IOException@Nullable protected java.io.InputStream getInputStreamVanilla(java.lang.String pathIn)
public boolean resourceExists(ResourcePackType type, ResourceLocation location)
resourceExists in interface IResourcePackpublic java.util.Set<java.lang.String> getResourceNamespaces(ResourcePackType type)
getResourceNamespaces in interface IResourcePack@Nullable public <T> T getMetadata(IMetadataSectionSerializer<T> deserializer) throws java.io.IOException
getMetadata in interface IResourcePackjava.io.IOExceptionpublic java.lang.String getName()
getName in interface IResourcePackpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableprivate java.io.InputStream getExtraInputStream(ResourcePackType type, java.lang.String resource)