| 1 | package net.minecraft.client.gui.font;
|
| 2 |
|
| 3 | import com.google.common.collect.Lists;
|
| 4 | import com.google.gson.Gson;
|
| 5 | import com.google.gson.GsonBuilder;
|
| 6 | import com.google.gson.JsonElement;
|
| 7 | import com.google.gson.JsonParseException;
|
| 8 | import com.mojang.blaze3d.font.GlyphProvider;
|
| 9 | import com.mojang.datafixers.util.Either;
|
| 10 | import com.mojang.datafixers.util.Pair;
|
| 11 | import com.mojang.logging.LogUtils;
|
| 12 | import com.mojang.serialization.Codec;
|
| 13 | import com.mojang.serialization.JsonOps;
|
| 14 | import com.mojang.serialization.codecs.RecordCodecBuilder;
|
| 15 | import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
| 16 | import it.unimi.dsi.fastutil.ints.IntSet;
|
| 17 | import java.io.Reader;
|
| 18 | import java.util.ArrayList;
|
| 19 | import java.util.EnumSet;
|
| 20 | import java.util.HashMap;
|
| 21 | import java.util.HashSet;
|
| 22 | import java.util.List;
|
| 23 | import java.util.Map;
|
| 24 | import java.util.Optional;
|
| 25 | import java.util.Set;
|
| 26 | import java.util.Map.Entry;
|
| 27 | import java.util.concurrent.CompletableFuture;
|
| 28 | import java.util.concurrent.Executor;
|
| 29 | import java.util.function.Consumer;
|
| 30 | import java.util.function.Function;
|
| 31 | import java.util.stream.Stream;
|
| 32 | import net.fabricmc.api.EnvType;
|
| 33 | import net.fabricmc.api.Environment;
|
| 34 | import net.minecraft.client.Minecraft;
|
| 35 | import net.minecraft.client.Options;
|
| 36 | import net.minecraft.client.gui.Font;
|
| 37 | import net.minecraft.client.gui.GlyphSource;
|
| 38 | import net.minecraft.client.gui.font.FontManager.CachedFontProvider.CachedEntry;
|
| 39 | import net.minecraft.client.gui.font.glyphs.EffectGlyph;
|
| 40 | import net.minecraft.client.gui.font.providers.GlyphProviderDefinition;
|
| 41 | import net.minecraft.client.renderer.PlayerSkinRenderCache;
|
| 42 | import net.minecraft.client.renderer.texture.TextureManager;
|
| 43 | import net.minecraft.client.resources.model.sprite.AtlasManager;
|
| 44 | import net.minecraft.network.chat.FontDescription;
|
| 45 | import net.minecraft.network.chat.FontDescription.AtlasSprite;
|
| 46 | import net.minecraft.network.chat.FontDescription.PlayerSprite;
|
| 47 | import net.minecraft.resources.FileToIdConverter;
|
| 48 | import net.minecraft.resources.Identifier;
|
| 49 | import net.minecraft.server.packs.resources.PreparableReloadListener;
|
| 50 | import net.minecraft.server.packs.resources.Resource;
|
| 51 | import net.minecraft.server.packs.resources.ResourceManager;
|
| 52 | import net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier;
|
| 53 | import net.minecraft.server.packs.resources.PreparableReloadListener.SharedState;
|
| 54 | import net.minecraft.util.DependencySorter;
|
| 55 | import net.minecraft.util.Util;
|
| 56 | import net.minecraft.util.profiling.Profiler;
|
| 57 | import net.minecraft.util.profiling.ProfilerFiller;
|
| 58 | import org.jspecify.annotations.Nullable;
|
| 59 | import org.slf4j.Logger;
|
| 60 |
|
| 61 | @Environment(EnvType.CLIENT)
|
| 62 | public class FontManager implements AutoCloseable, PreparableReloadListener {
|
| 63 | private static final Logger LOGGER = LogUtils.getLogger();
|
| 64 | private static final String FONTS_PATH = "fonts.json";
|
| 65 | public static final Identifier MISSING_FONT = Identifier.withDefaultNamespace("missing");
|
| 66 | private static final FileToIdConverter FONT_DEFINITIONS = FileToIdConverter.json("font");
|
| 67 | private static final Gson GSON = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create();
|
| 68 | private final FontSet missingFontSet;
|
| 69 | private final List<GlyphProvider> providersToClose = new ArrayList<>();
|
| 70 | private final Map<Identifier, FontSet> fontSets = new HashMap<>();
|
| 71 | private final TextureManager textureManager;
|
| 72 | private final FontManager.CachedFontProvider anyGlyphs = new FontManager.CachedFontProvider(false);
|
| 73 | private final FontManager.CachedFontProvider nonFishyGlyphs = new FontManager.CachedFontProvider(true);
|
| 74 | private final AtlasManager atlasManager;
|
| 75 | private final Map<Identifier, AtlasGlyphProvider> atlasProviders = new HashMap<>();
|
| 76 | private final PlayerGlyphProvider playerProvider;
|
| 77 |
|
| 78 | public FontManager(final TextureManager textureManager, final AtlasManager atlasManager, final PlayerSkinRenderCache playerSkinRenderCache) {
|
| 79 | this.textureManager = textureManager;
|
| 80 | this.atlasManager = atlasManager;
|
| 81 | this.missingFontSet = this.createFontSet(MISSING_FONT, List.of(createFallbackProvider()), Set.of());
|
| 82 | this.playerProvider = new PlayerGlyphProvider(playerSkinRenderCache);
|
| 83 | }
|
| 84 |
|
| 85 | private FontSet createFontSet(final Identifier id, final List<GlyphProvider.Conditional> providers, final Set<FontOption> options) {
|
| 86 | GlyphStitcher stitcher = new GlyphStitcher(this.textureManager, id);
|
| 87 | FontSet result = new FontSet(stitcher);
|
| 88 | result.reload(providers, options);
|
| 89 | return result;
|
| 90 | }
|
| 91 |
|
| 92 | private static GlyphProvider.Conditional createFallbackProvider() {
|
| 93 | return new GlyphProvider.Conditional(new AllMissingGlyphProvider(), FontOption.Filter.ALWAYS_PASS);
|
| 94 | }
|
| 95 |
|
| 96 | @Override
|
| 97 | public CompletableFuture<Void> reload(
|
| 98 | final SharedState currentReload, final Executor taskExecutor, final PreparationBarrier preparationBarrier, final Executor reloadExecutor
|
| 99 | ) {
|
| 100 | return this.prepare(currentReload.resourceManager(), taskExecutor)
|
| 101 | .thenCompose(preparationBarrier::wait)
|
| 102 | .thenAcceptAsync(preparations -> this.apply(preparations, Profiler.get()), reloadExecutor);
|
| 103 | }
|
| 104 |
|
| 105 | private CompletableFuture<FontManager.Preparation> prepare(final ResourceManager manager, final Executor executor) {
|
| 106 | List<CompletableFuture<FontManager.UnresolvedBuilderBundle>> builderFutures = new ArrayList<>();
|
| 107 |
|
| 108 | for (Entry<Identifier, List<Resource>> fontStack : FONT_DEFINITIONS.listMatchingResourceStacks(manager).entrySet()) {
|
| 109 | Identifier fontName = FONT_DEFINITIONS.fileToId(fontStack.getKey());
|
| 110 | builderFutures.add(CompletableFuture.supplyAsync(() -> {
|
| 111 | List<Pair<FontManager.BuilderId, GlyphProviderDefinition.Conditional>> builderStack = loadResourceStack(fontStack.getValue(), fontName);
|
| 112 | FontManager.UnresolvedBuilderBundle bundle = new FontManager.UnresolvedBuilderBundle(fontName);
|
| 113 |
|
| 114 | for (Pair<FontManager.BuilderId, GlyphProviderDefinition.Conditional> stackEntry : builderStack) {
|
| 115 | FontManager.BuilderId id = stackEntry.getFirst();
|
| 116 | FontOption.Filter options = stackEntry.getSecond().filter();
|
| 117 | stackEntry.getSecond().definition().unpack().ifLeft(provider -> {
|
| 118 | CompletableFuture<Optional<GlyphProvider>> loadResult = this.safeLoad(id, provider, manager, executor);
|
| 119 | bundle.add(id, options, loadResult);
|
| 120 | }).ifRight(reference -> bundle.add(id, options, reference));
|
| 121 | }
|
| 122 |
|
| 123 | return bundle;
|
| 124 | }, executor));
|
| 125 | }
|
| 126 |
|
| 127 | return Util.sequence(builderFutures)
|
| 128 | .thenCompose(
|
| 129 | builders -> {
|
| 130 | List<CompletableFuture<Optional<GlyphProvider>>> allProviderFutures = builders.stream()
|
| 131 | .flatMap(FontManager.UnresolvedBuilderBundle::listBuilders)
|
| 132 | .collect(Util.toMutableList());
|
| 133 | GlyphProvider.Conditional fallback = createFallbackProvider();
|
| 134 | allProviderFutures.add(CompletableFuture.completedFuture(Optional.of(fallback.provider())));
|
| 135 | return Util.sequence(allProviderFutures)
|
| 136 | .thenCompose(
|
| 137 | allProviders -> {
|
| 138 | Map<Identifier, List<GlyphProvider.Conditional>> resolved = this.resolveProviders(builders);
|
| 139 | CompletableFuture<?>[] finalizers = resolved.values()
|
| 140 | .stream()
|
| 141 | .map(providers -> CompletableFuture.runAsync(() -> this.finalizeProviderLoading(providers, fallback), executor))
|
| 142 | .toArray(CompletableFuture[]::new);
|
| 143 | return CompletableFuture.allOf(finalizers).thenApply(ignored -> {
|
| 144 | List<GlyphProvider> providersToClose = allProviders.stream().flatMap(Optional::stream).toList();
|
| 145 | return new FontManager.Preparation(resolved, providersToClose);
|
| 146 | });
|
| 147 | }
|
| 148 | );
|
| 149 | }
|
| 150 | );
|
| 151 | }
|
| 152 |
|
| 153 | private CompletableFuture<Optional<GlyphProvider>> safeLoad(
|
| 154 | final FontManager.BuilderId id, final GlyphProviderDefinition.Loader provider, final ResourceManager manager, final Executor executor
|
| 155 | ) {
|
| 156 | return CompletableFuture.supplyAsync(() -> {
|
| 157 | try {
|
| 158 | return Optional.of(provider.load(manager));
|
| 159 | } catch (Exception e) {
|
| 160 | LOGGER.warn("Failed to load builder {}, rejecting", id, e);
|
| 161 | return Optional.empty();
|
| 162 | }
|
| 163 | }, executor);
|
| 164 | }
|
| 165 |
|
| 166 | private Map<Identifier, List<GlyphProvider.Conditional>> resolveProviders(final List<FontManager.UnresolvedBuilderBundle> unresolvedProviders) {
|
| 167 | Map<Identifier, List<GlyphProvider.Conditional>> result = new HashMap<>();
|
| 168 | DependencySorter<Identifier, FontManager.UnresolvedBuilderBundle> sorter = new DependencySorter<>();
|
| 169 | unresolvedProviders.forEach(e -> sorter.addEntry(e.fontId, e));
|
| 170 | sorter.orderByDependencies((id, bundle) -> bundle.resolve(result::get).ifPresent(r -> result.put(id, (List<GlyphProvider.Conditional>)r)));
|
| 171 | return result;
|
| 172 | }
|
| 173 |
|
| 174 | private void finalizeProviderLoading(final List<GlyphProvider.Conditional> list, final GlyphProvider.Conditional fallback) {
|
| 175 | list.add(0, fallback);
|
| 176 | IntSet supportedGlyphs = new IntOpenHashSet();
|
| 177 |
|
| 178 | for (GlyphProvider.Conditional provider : list) {
|
| 179 | supportedGlyphs.addAll(provider.provider().getSupportedGlyphs());
|
| 180 | }
|
| 181 |
|
| 182 | supportedGlyphs.forEach(codepoint -> {
|
| 183 | if (codepoint != 32) {
|
| 184 | for (GlyphProvider.Conditional providerx : Lists.reverse(list)) {
|
| 185 | if (providerx.provider().getGlyph(codepoint) != null) {
|
| 186 | break;
|
| 187 | }
|
| 188 | }
|
| 189 | }
|
| 190 | });
|
| 191 | }
|
| 192 |
|
| 193 | private static Set<FontOption> getFontOptions(final Options options) {
|
| 194 | Set<FontOption> result = EnumSet.noneOf(FontOption.class);
|
| 195 | if (options.forceUnicodeFont().get()) {
|
| 196 | result.add(FontOption.UNIFORM);
|
| 197 | }
|
| 198 |
|
| 199 | if (options.japaneseGlyphVariants().get()) {
|
| 200 | result.add(FontOption.JAPANESE_VARIANTS);
|
| 201 | }
|
| 202 |
|
| 203 | return result;
|
| 204 | }
|
| 205 |
|
| 206 | private void apply(final FontManager.Preparation preparations, final ProfilerFiller profiler) {
|
| 207 | profiler.push("closing");
|
| 208 | this.anyGlyphs.invalidate();
|
| 209 | this.nonFishyGlyphs.invalidate();
|
| 210 | this.fontSets.values().forEach(FontSet::close);
|
| 211 | this.fontSets.clear();
|
| 212 | this.providersToClose.forEach(GlyphProvider::close);
|
| 213 | this.providersToClose.clear();
|
| 214 | Set<FontOption> fontOptions = getFontOptions(Minecraft.getInstance().options);
|
| 215 | profiler.popPush("reloading");
|
| 216 | preparations.fontSets()
|
| 217 | .forEach((id, newProviders) -> this.fontSets.put(id, this.createFontSet(id, Lists.reverse((List<GlyphProvider.Conditional>)newProviders), fontOptions)));
|
| 218 | this.providersToClose.addAll(preparations.allProviders);
|
| 219 | profiler.pop();
|
| 220 | if (!this.fontSets.containsKey(Minecraft.DEFAULT_FONT)) {
|
| 221 | throw new IllegalStateException("Default font failed to load");
|
| 222 | }
|
| 223 |
|
| 224 | this.atlasProviders.clear();
|
| 225 | this.atlasManager.forEach((atlasId, atlasTexture) -> this.atlasProviders.put(atlasId, new AtlasGlyphProvider(atlasTexture)));
|
| 226 | }
|
| 227 |
|
| 228 | public void updateOptions(final Options options) {
|
| 229 | Set<FontOption> fontOptions = getFontOptions(options);
|
| 230 |
|
| 231 | for (FontSet value : this.fontSets.values()) {
|
| 232 | value.reload(fontOptions);
|
| 233 | }
|
| 234 |
|
| 235 | this.anyGlyphs.invalidate();
|
| 236 | this.nonFishyGlyphs.invalidate();
|
| 237 | }
|
| 238 |
|
| 239 | private static List<Pair<FontManager.BuilderId, GlyphProviderDefinition.Conditional>> loadResourceStack(
|
| 240 | final List<Resource> resourceStack, final Identifier fontName
|
| 241 | ) {
|
| 242 | List<Pair<FontManager.BuilderId, GlyphProviderDefinition.Conditional>> builderStack = new ArrayList<>();
|
| 243 |
|
| 244 | for (Resource resource : resourceStack) {
|
| 245 | try (Reader reader = resource.openAsReader()) {
|
| 246 | JsonElement jsonContents = GSON.fromJson(reader, JsonElement.class);
|
| 247 | FontManager.FontDefinitionFile definition = FontManager.FontDefinitionFile.CODEC.parse(JsonOps.INSTANCE, jsonContents).getOrThrow(JsonParseException::new);
|
| 248 | List<GlyphProviderDefinition.Conditional> providers = definition.providers;
|
| 249 |
|
| 250 | for (int i = providers.size() - 1; i >= 0; i--) {
|
| 251 | FontManager.BuilderId id = new FontManager.BuilderId(fontName, resource.sourcePackId(), i);
|
| 252 | builderStack.add(Pair.of(id, providers.get(i)));
|
| 253 | }
|
| 254 | } catch (Exception e) {
|
| 255 | LOGGER.warn("Unable to load font '{}' in {} in resourcepack: '{}'", fontName, "fonts.json", resource.sourcePackId(), e);
|
| 256 | }
|
| 257 | }
|
| 258 |
|
| 259 | return builderStack;
|
| 260 | }
|
| 261 |
|
| 262 | public Font createFont() {
|
| 263 | return new Font(this.anyGlyphs);
|
| 264 | }
|
| 265 |
|
| 266 | public Font createFontFilterFishy() {
|
| 267 | return new Font(this.nonFishyGlyphs);
|
| 268 | }
|
| 269 |
|
| 270 | private FontSet getFontSetRaw(final Identifier id) {
|
| 271 | return this.fontSets.getOrDefault(id, this.missingFontSet);
|
| 272 | }
|
| 273 |
|
| 274 | private GlyphSource getSpriteFont(final AtlasSprite contents) {
|
| 275 | AtlasGlyphProvider provider = this.atlasProviders.get(contents.atlasId());
|
| 276 | return provider == null ? this.missingFontSet.source(false) : provider.sourceForSprite(contents.spriteId());
|
| 277 | }
|
| 278 |
|
| 279 | @Override
|
| 280 | public void close() {
|
| 281 | this.anyGlyphs.close();
|
| 282 | this.nonFishyGlyphs.close();
|
| 283 | this.fontSets.values().forEach(FontSet::close);
|
| 284 | this.providersToClose.forEach(GlyphProvider::close);
|
| 285 | this.missingFontSet.close();
|
| 286 | }
|
| 287 |
|
| 288 | @Environment(EnvType.CLIENT)
|
| 289 | private record BuilderId(Identifier fontId, String pack, int index) {
|
| 290 | @Override
|
| 291 | public String toString() {
|
| 292 | return "(" + this.fontId + ": builder #" + this.index + " from pack " + this.pack + ")";
|
| 293 | }
|
| 294 | }
|
| 295 |
|
| 296 | @Environment(EnvType.CLIENT)
|
| 297 | private record BuilderResult(FontManager.BuilderId id, FontOption.Filter filter, Either<CompletableFuture<Optional<GlyphProvider>>, Identifier> result) {
|
| 298 | public Optional<List<GlyphProvider.Conditional>> resolve(final Function<Identifier, @Nullable List<GlyphProvider.Conditional>> resolver) {
|
| 299 | return this.result
|
| 300 | .map(
|
| 301 | provider -> provider.join().map(p -> List.of(new GlyphProvider.Conditional(p, this.filter))),
|
| 302 | reference -> {
|
| 303 | List<GlyphProvider.Conditional> resolvedReferences = resolver.apply(reference);
|
| 304 | if (resolvedReferences == null) {
|
| 305 | FontManager.LOGGER
|
| 306 | .warn("Can't find font {} referenced by builder {}, either because it's missing, failed to load or is part of loading cycle", reference, this.id);
|
| 307 | return Optional.empty();
|
| 308 | } else {
|
| 309 | return Optional.of(resolvedReferences.stream().map(this::mergeFilters).toList());
|
| 310 | }
|
| 311 | }
|
| 312 | );
|
| 313 | }
|
| 314 |
|
| 315 | private GlyphProvider.Conditional mergeFilters(final GlyphProvider.Conditional original) {
|
| 316 | return new GlyphProvider.Conditional(original.provider(), this.filter.merge(original.filter()));
|
| 317 | }
|
| 318 | }
|
| 319 |
|
| 320 | @Environment(EnvType.CLIENT)
|
| 321 | private class CachedFontProvider implements Font.Provider, AutoCloseable {
|
| 322 | private final boolean nonFishyOnly;
|
| 323 | private volatile @Nullable CachedEntry lastEntry;
|
| 324 | private volatile @Nullable EffectGlyph whiteGlyph;
|
| 325 |
|
| 326 | private CachedFontProvider(final boolean nonFishyOnly) {
|
| 327 | this.nonFishyOnly = nonFishyOnly;
|
| 328 | }
|
| 329 |
|
| 330 | public void invalidate() {
|
| 331 | this.lastEntry = null;
|
| 332 | this.whiteGlyph = null;
|
| 333 | }
|
| 334 |
|
| 335 | @Override
|
| 336 | public void close() {
|
| 337 | this.invalidate();
|
| 338 | }
|
| 339 |
|
| 340 | private GlyphSource getGlyphSource(final FontDescription description) {
|
| 341 | return switch (description) {
|
| 342 | case net.minecraft.network.chat.FontDescription.Resource resource -> FontManager.this.getFontSetRaw(resource.id()).source(this.nonFishyOnly);
|
| 343 | case AtlasSprite sprite -> FontManager.this.getSpriteFont(sprite);
|
| 344 | case PlayerSprite player -> FontManager.this.playerProvider.sourceForPlayer(player);
|
| 345 | default -> FontManager.this.missingFontSet.source(this.nonFishyOnly);
|
| 346 | };
|
| 347 | }
|
| 348 |
|
| 349 | @Override
|
| 350 | public GlyphSource glyphs(final FontDescription description) {
|
| 351 | CachedEntry lastEntry = this.lastEntry;
|
| 352 | if (lastEntry != null && description.equals(lastEntry.description)) {
|
| 353 | return lastEntry.source;
|
| 354 | }
|
| 355 |
|
| 356 | GlyphSource result = this.getGlyphSource(description);
|
| 357 | this.lastEntry = new CachedEntry(description, result);
|
| 358 | return result;
|
| 359 | }
|
| 360 |
|
| 361 | @Override
|
| 362 | public EffectGlyph effect() {
|
| 363 | EffectGlyph whiteGlyph = this.whiteGlyph;
|
| 364 | if (whiteGlyph == null) {
|
| 365 | whiteGlyph = FontManager.this.getFontSetRaw(FontDescription.DEFAULT.id()).whiteGlyph();
|
| 366 | this.whiteGlyph = whiteGlyph;
|
| 367 | }
|
| 368 |
|
| 369 | return whiteGlyph;
|
| 370 | }
|
| 371 | }
|
| 372 |
|
| 373 | @Environment(EnvType.CLIENT)
|
| 374 | private record FontDefinitionFile(List<GlyphProviderDefinition.Conditional> providers) {
|
| 375 | public static final Codec<FontManager.FontDefinitionFile> CODEC = RecordCodecBuilder.create(
|
| 376 | i -> i.group(GlyphProviderDefinition.Conditional.CODEC.listOf().fieldOf("providers").forGetter(FontManager.FontDefinitionFile::providers))
|
| 377 | .apply(i, FontManager.FontDefinitionFile::new)
|
| 378 | );
|
| 379 | }
|
| 380 |
|
| 381 | @Environment(EnvType.CLIENT)
|
| 382 | private record Preparation(Map<Identifier, List<GlyphProvider.Conditional>> fontSets, List<GlyphProvider> allProviders) {
|
| 383 | }
|
| 384 |
|
| 385 | @Environment(EnvType.CLIENT)
|
| 386 | private record UnresolvedBuilderBundle(Identifier fontId, List<FontManager.BuilderResult> builders, Set<Identifier> dependencies)
|
| 387 | implements net.minecraft.util.DependencySorter.Entry<Identifier> {
|
| 388 | public UnresolvedBuilderBundle(final Identifier fontId) {
|
| 389 | this(fontId, new ArrayList<>(), new HashSet<>());
|
| 390 | }
|
| 391 |
|
| 392 | public void add(final FontManager.BuilderId builderId, final FontOption.Filter filter, final GlyphProviderDefinition.Reference reference) {
|
| 393 | this.builders.add(new FontManager.BuilderResult(builderId, filter, Either.right(reference.id())));
|
| 394 | this.dependencies.add(reference.id());
|
| 395 | }
|
| 396 |
|
| 397 | public void add(final FontManager.BuilderId builderId, final FontOption.Filter filter, final CompletableFuture<Optional<GlyphProvider>> provider) {
|
| 398 | this.builders.add(new FontManager.BuilderResult(builderId, filter, Either.left(provider)));
|
| 399 | }
|
| 400 |
|
| 401 | private Stream<CompletableFuture<Optional<GlyphProvider>>> listBuilders() {
|
| 402 | return this.builders.stream().flatMap(e -> e.result.left().stream());
|
| 403 | }
|
| 404 |
|
| 405 | public Optional<List<GlyphProvider.Conditional>> resolve(final Function<Identifier, List<GlyphProvider.Conditional>> resolver) {
|
| 406 | List<GlyphProvider.Conditional> resolved = new ArrayList<>();
|
| 407 |
|
| 408 | for (FontManager.BuilderResult builder : this.builders) {
|
| 409 | Optional<List<GlyphProvider.Conditional>> resolvedBuilder = builder.resolve(resolver);
|
| 410 | if (!resolvedBuilder.isPresent()) {
|
| 411 | return Optional.empty();
|
| 412 | }
|
| 413 |
|
| 414 | resolved.addAll(resolvedBuilder.get());
|
| 415 | }
|
| 416 |
|
| 417 | return Optional.of(resolved);
|
| 418 | }
|
| 419 |
|
| 420 | @Override
|
| 421 | public void visitRequiredDependencies(final Consumer<Identifier> output) {
|
| 422 | this.dependencies.forEach(output);
|
| 423 | }
|
| 424 |
|
| 425 | @Override
|
| 426 | public void visitOptionalDependencies(final Consumer<Identifier> output) {
|
| 427 | }
|
| 428 | }
|
| 429 | }
|
| 430 |
|