public class NamespaceResourceManager extends Object implements ResourceManager
Modifier and Type | Class and Description |
---|---|
(package private) static class |
NamespaceResourceManager.DebugInputStream |
ResourceManager.Empty
Modifier and Type | Field and Description |
---|---|
private static Logger |
LOGGER |
private String |
namespace |
protected List<ResourcePack> |
packList |
private ResourceType |
type |
Constructor and Description |
---|
NamespaceResourceManager(ResourceType type,
String namespace) |
Modifier and Type | Method and Description |
---|---|
void |
addPack(ResourcePack pack) |
boolean |
containsResource(Identifier id) |
Collection<Identifier> |
findResources(String resourceType,
Predicate<String> pathPredicate) |
Set<String> |
getAllNamespaces() |
List<Resource> |
getAllResources(Identifier id) |
(package private) static Identifier |
getMetadataPath(Identifier id) |
Resource |
getResource(Identifier id) |
private boolean |
isPathAbsolute(Identifier id) |
protected InputStream |
open(Identifier id,
ResourcePack pack) |
Stream<ResourcePack> |
streamResourcePacks() |
private void |
validate(Identifier id) |
private static final Logger LOGGER
protected final List<ResourcePack> packList
private final ResourceType type
private final String namespace
public NamespaceResourceManager(ResourceType type, String namespace)
public void addPack(ResourcePack pack)
@Environment(value=CLIENT) public Set<String> getAllNamespaces()
getAllNamespaces
in interface ResourceManager
public Resource getResource(Identifier id) throws IOException
getResource
in interface ResourceManager
IOException
@Environment(value=CLIENT) public boolean containsResource(Identifier id)
containsResource
in interface ResourceManager
protected InputStream open(Identifier id, ResourcePack pack) throws IOException
IOException
private void validate(Identifier id) throws IOException
IOException
private boolean isPathAbsolute(Identifier id)
public List<Resource> getAllResources(Identifier id)
getAllResources
in interface ResourceManager
public Collection<Identifier> findResources(String resourceType, Predicate<String> pathPredicate)
findResources
in interface ResourceManager
@Environment(value=CLIENT) public Stream<ResourcePack> streamResourcePacks()
streamResourcePacks
in interface ResourceManager
static Identifier getMetadataPath(Identifier id)