Interface MinecraftResolver.Context

  • All Known Implementing Classes:
    MinecraftResolverImpl
    Enclosing interface:
    MinecraftResolver

    public static interface MinecraftResolver.Context
    Context available to individual artifact modifier steps.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.function.Supplier<java.net.URLClassLoader> classLoaderWithTool​(ResolvableTool tool)
      Return a child classloader with a tool and its dependencies on the classpath, as well as the VanillaGradle jar.
      org.spongepowered.gradle.vanilla.resolver.Downloader downloader()
      A downloader for resources, configured to resolve to the shared cache by default.
      java.util.concurrent.Executor executor()
      An executor for performing asynchronous operations.
      java.util.concurrent.Executor syncExecutor()
      An executor for performing main-thread synchronous operations, like some dependency resolution.
      VersionManifestRepository versions()
      A repository exposing the Mojang launcher metadata API.
    • Method Detail

      • versions

        VersionManifestRepository versions()
        A repository exposing the Mojang launcher metadata API.
        Returns:
        the manifest repository
      • downloader

        org.spongepowered.gradle.vanilla.resolver.Downloader downloader()
        A downloader for resources, configured to resolve to the shared cache by default.
        Returns:
        the downloader instance
      • executor

        java.util.concurrent.Executor executor()
        An executor for performing asynchronous operations.
        Returns:
        the environment's executor
      • syncExecutor

        java.util.concurrent.Executor syncExecutor()
        An executor for performing main-thread synchronous operations, like some dependency resolution.
        Returns:
        the synchronous executor
      • classLoaderWithTool

        java.util.function.Supplier<java.net.URLClassLoader> classLoaderWithTool​(ResolvableTool tool)
        Return a child classloader with a tool and its dependencies on the classpath, as well as the VanillaGradle jar.

        This is a very fragile arrangement but it allows some dependencies to be overridden at runtime. Classes from Gradle, VanillaGradle's dependencies, and the JDK can be safely shared, but VanillaGradle classes CAN NOT.

        This must be run on the syncExecutor().

        Parameters:
        tool - the tool to resolve
        Returns:
        a class loader with the tool on the classpath