Interface MinecraftResolver
-
- All Known Implementing Classes:
MinecraftResolverImpl
public interface MinecraftResolver
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceMinecraftResolver.ContextContext available to individual artifact modifier steps.static interfaceMinecraftResolver.MinecraftEnvironment
-
Field Summary
Fields Modifier and Type Field Description static intMETADATA_VERSIONA version for stored metadata.static intSTORAGE_VERSIONA version indicator for on-disk storage.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> TprocessSyncTasksUntilComplete(java.util.concurrent.CompletableFuture<T> future)Block on the completion of a provided future, processing "sync" tasks while that occurs.java.util.concurrent.CompletableFuture<org.spongepowered.gradle.vanilla.resolver.ResolutionResult<java.nio.file.Path>>produceAssociatedArtifact(MinecraftPlatform side, java.lang.String version, java.util.Set<ArtifactModifier> modifiers, java.lang.String id, java.util.Set<AssociatedResolutionFlags> flags, java.util.function.BiFunction<MinecraftResolver.MinecraftEnvironment,java.nio.file.Path,java.util.concurrent.CompletableFuture<?>> action)Given a standard Minecraft artifact, produce a variant of that artifact.java.util.concurrent.CompletableFuture<org.spongepowered.gradle.vanilla.resolver.ResolutionResult<MinecraftResolver.MinecraftEnvironment>>provide(MinecraftPlatform side, java.lang.String version)java.util.concurrent.CompletableFuture<org.spongepowered.gradle.vanilla.resolver.ResolutionResult<MinecraftResolver.MinecraftEnvironment>>provide(MinecraftPlatform side, java.lang.String version, java.util.Set<ArtifactModifier> modifiers)VersionManifestRepositoryversions()Get the version manifest repository managed by this resolver.
-
-
-
Field Detail
-
STORAGE_VERSION
static final int STORAGE_VERSION
A version indicator for on-disk storage.When a change in how Minecraft artifacts exists that cannot be detected by existing input detection, or would make data unreadable by older versions of the resolver, this version will be incremented.
- See Also:
- Constant Field Values
-
METADATA_VERSION
static final int METADATA_VERSION
A version for stored metadata.Whenever the
STORAGE_VERSIONis incremented, this version will be reset to1- See Also:
- Constant Field Values
-
-
Method Detail
-
versions
VersionManifestRepository versions()
Get the version manifest repository managed by this resolver.- Returns:
- the resolver
-
provide
java.util.concurrent.CompletableFuture<org.spongepowered.gradle.vanilla.resolver.ResolutionResult<MinecraftResolver.MinecraftEnvironment>> provide(MinecraftPlatform side, java.lang.String version)
-
provide
java.util.concurrent.CompletableFuture<org.spongepowered.gradle.vanilla.resolver.ResolutionResult<MinecraftResolver.MinecraftEnvironment>> provide(MinecraftPlatform side, java.lang.String version, java.util.Set<ArtifactModifier> modifiers)
-
produceAssociatedArtifact
java.util.concurrent.CompletableFuture<org.spongepowered.gradle.vanilla.resolver.ResolutionResult<java.nio.file.Path>> produceAssociatedArtifact(MinecraftPlatform side, java.lang.String version, java.util.Set<ArtifactModifier> modifiers, java.lang.String id, java.util.Set<AssociatedResolutionFlags> flags, java.util.function.BiFunction<MinecraftResolver.MinecraftEnvironment,java.nio.file.Path,java.util.concurrent.CompletableFuture<?>> action)
Given a standard Minecraft artifact, produce a variant of that artifact.This variant will synchronize back to the current thread before executing the provider function. This allows for operating in concurrency-sensitive environments, such as a Gradle build.
To de-duplicate resolution actions, a future may be returned if this action has already been performed, or is in process on another thread. In these cases, the provided provider function will not be executed at all.
- Parameters:
side- the platform to base off ofversion- the version to base off ofmodifiers- any modifiers to complete the description of the provided argumentid- An identifier for this artifactflags- flags to configure this resolutionaction- the action needed to produce a variant, taking the input environment and a target path- Returns:
- a future returning the result of resolving a jar path
-
processSyncTasksUntilComplete
<T> T processSyncTasksUntilComplete(java.util.concurrent.CompletableFuture<T> future) throws java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionBlock on the completion of a provided future, processing "sync" tasks while that occurs.- Type Parameters:
T- the return value type- Parameters:
future- the future to await- Returns:
- the result of the future
- Throws:
java.util.concurrent.ExecutionException- if the task execution failsjava.lang.InterruptedException- if the thread executing the future is interrupted
-
-