Java 类net.minecraft.client.resources.FallbackResourceManager 实例源码

项目:Novous    文件:Implementation.java   
/**
 * Registers domains to resource manager from resource listeners.
 * @param novousLogger
 */
private static void handleResourceManager(Logger novousLogger) {
    novousLogger.info("Registering resource manager test...");
    ResourceLinker.REGISTERED_RESOURCE_LINKERS.add(new TestResourceLinker());
    novousLogger.info("Registering abstract resource linked manager...");
    PairedRegistry<String, FallbackResourceManager> resourceManagerRegistry =
            (PairedRegistry<String, FallbackResourceManager>) Minecraft
            .getMinecraft().getResourceManager();
    for (ResourceLinker linker : ResourceLinker.REGISTERED_RESOURCE_LINKERS) {
        linker.getLinkedDomains().forEach((domain) -> resourceManagerRegistry.register
            (domain, new
                LinkedResourceManager()));
    }
    novousLogger.info("Testing resource linked manager...");
    TestResourceLinker.checkTestSuccess();
}
项目:Novous    文件:MixinSimpleReloadableResourceManager.java   
@Override
public void register(String s, FallbackResourceManager fallbackResourceManager) {
    domainResourceManagers.put(s, fallbackResourceManager);
}
项目:Novous    文件:MixinSimpleReloadableResourceManager.java   
@Override
public Pair<String, FallbackResourceManager>[] getRegistrationPairs() {
    List<Pair<String, FallbackResourceManager>> pairs = new ArrayList<>();
    domainResourceManagers.forEach((key, fallbackManager) -> pairs.add(Pair.of(key, fallbackManager)));
    return pairs.toArray(new Pair[pairs.size()]);
}