public abstract class AbstractFileResourcePack extends Object implements ResourcePack
Modifier and Type | Field and Description |
---|---|
protected File |
base |
private static Logger |
LOGGER |
Constructor and Description |
---|
AbstractFileResourcePack(File base) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(ResourceType type,
Identifier id) |
protected abstract boolean |
containsFile(String name) |
private static String |
getFilename(ResourceType type,
Identifier id) |
String |
getName() |
InputStream |
open(ResourceType type,
Identifier id) |
protected abstract InputStream |
openFile(String name) |
InputStream |
openRoot(String fileName) |
<T> T |
parseMetadata(ResourceMetadataReader<T> metaReader) |
static <T> T |
parseMetadata(ResourceMetadataReader<T> metaReader,
InputStream inputStream) |
protected static String |
relativize(File base,
File target) |
protected void |
warnNonLowerCaseNamespace(String namespace) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, findResources, getNamespaces
public AbstractFileResourcePack(File base)
private static String getFilename(ResourceType type, Identifier id)
public InputStream open(ResourceType type, Identifier id) throws IOException
open
in interface ResourcePack
IOException
public boolean contains(ResourceType type, Identifier id)
contains
in interface ResourcePack
protected abstract InputStream openFile(String name) throws IOException
IOException
@Environment(value=CLIENT) public InputStream openRoot(String fileName) throws IOException
openRoot
in interface ResourcePack
IOException
protected abstract boolean containsFile(String name)
protected void warnNonLowerCaseNamespace(String namespace)
@Nullable public <T> T parseMetadata(ResourceMetadataReader<T> metaReader)
parseMetadata
in interface ResourcePack
@Nullable public static <T> T parseMetadata(ResourceMetadataReader<T> metaReader, InputStream inputStream)
public String getName()
getName
in interface ResourcePack