public class ReloadableResourceManagerImpl extends Object implements ReloadableResourceManager
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ReloadableResourceManagerImpl.FailedResourceReloadMonitor |
static class |
ReloadableResourceManagerImpl.PackAdditionFailedException |
ResourceManager.Empty
Modifier and Type | Field and Description |
---|---|
private List<ResourcePack> |
field_25145 |
private List<ResourceReloadListener> |
initialListeners |
private List<ResourceReloadListener> |
listeners |
private static Logger |
LOGGER |
private Map<String,NamespaceResourceManager> |
namespaceManagers |
private Set<String> |
namespaces |
private ResourceType |
type |
Constructor and Description |
---|
ReloadableResourceManagerImpl(ResourceType type) |
Modifier and Type | Method and Description |
---|---|
void |
addPack(ResourcePack resourcePack) |
ResourceReloadMonitor |
beginMonitoredReload(Executor prepareExecutor,
Executor applyExecutor,
CompletableFuture<Unit> initialStage,
List<ResourcePack> packs) |
protected ResourceReloadMonitor |
beginReloadInner(Executor prepareExecutor,
Executor applyExecutor,
List<ResourceReloadListener> listeners,
CompletableFuture<Unit> initialStage) |
private void |
clear() |
void |
close() |
boolean |
containsResource(Identifier id) |
Collection<Identifier> |
findResources(String resourceType,
Predicate<String> pathPredicate) |
Set<String> |
getAllNamespaces() |
List<Resource> |
getAllResources(Identifier id) |
Resource |
getResource(Identifier id) |
void |
registerListener(ResourceReloadListener listener) |
Stream<ResourcePack> |
streamResourcePacks() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
beginReload
private static final Logger LOGGER
private final Map<String,NamespaceResourceManager> namespaceManagers
private final List<ResourceReloadListener> listeners
private final List<ResourceReloadListener> initialListeners
private final List<ResourcePack> field_25145
private final ResourceType type
public ReloadableResourceManagerImpl(ResourceType type)
public void addPack(ResourcePack resourcePack)
@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
public List<Resource> getAllResources(Identifier id)
getAllResources
in interface ResourceManager
public Collection<Identifier> findResources(String resourceType, Predicate<String> pathPredicate)
findResources
in interface ResourceManager
private void clear()
public void close()
close
in interface AutoCloseable
close
in interface ReloadableResourceManager
public void registerListener(ResourceReloadListener listener)
registerListener
in interface ReloadableResourceManager
protected ResourceReloadMonitor beginReloadInner(Executor prepareExecutor, Executor applyExecutor, List<ResourceReloadListener> listeners, CompletableFuture<Unit> initialStage)
public ResourceReloadMonitor beginMonitoredReload(Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage, List<ResourcePack> packs)
beginMonitoredReload
in interface ReloadableResourceManager
@Environment(value=CLIENT) public Stream<ResourcePack> streamResourcePacks()
streamResourcePacks
in interface ResourceManager