Package net.kyori.adventure.resource
Interface ResourcePackInfo.Builder
- All Superinterfaces:
AbstractBuilder<ResourcePackInfo>
,ResourcePackInfoLike
- Enclosing interface:
- ResourcePackInfo
public static interface ResourcePackInfo.Builder
extends AbstractBuilder<ResourcePackInfo>, ResourcePackInfoLike
A builder for resource pack requests.
- Since:
- 4.15.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull ResourcePackInfo
Gets aResourcePackInfo
representation.@NotNull ResourcePackInfo
build()
Builds.default @NotNull CompletableFuture<ResourcePackInfo>
Builds, computing a hash based on the provided URL.@NotNull CompletableFuture<ResourcePackInfo>
computeHashAndBuild
(@NotNull Executor executor) Builds, computing a hash based on the provided URL.@NotNull ResourcePackInfo.Builder
Sets the hash.@NotNull ResourcePackInfo.Builder
Sets the id.@NotNull ResourcePackInfo.Builder
Sets the uri.
-
Method Details
-
id
Sets the id.- Parameters:
id
- the id- Returns:
- this builder
- Since:
- 4.15.0
-
uri
Sets the uri.If no UUID has been provided, setting a URL will set the ID to one based on the URL.
This parameter is required.
- Parameters:
uri
- the uri- Returns:
- this builder
- Since:
- 4.15.0
-
hash
@Contract("_ -> this") @NotNull @NotNull ResourcePackInfo.Builder hash(@NotNull @NotNull String hash) Sets the hash.- Parameters:
hash
- the hash- Returns:
- this builder
- Since:
- 4.15.0
-
build
Builds.- Specified by:
build
in interfaceAbstractBuilder<ResourcePackInfo>
- Returns:
- a new resource pack request
- Since:
- 4.15.0
-
computeHashAndBuild
Builds, computing a hash based on the provided URL.The hash computation will perform a network request asynchronously, exposing the completed info via the returned future.
- Returns:
- a future providing the new resource pack request
- Since:
- 4.15.0
-
computeHashAndBuild
@NotNull @NotNull CompletableFuture<ResourcePackInfo> computeHashAndBuild(@NotNull @NotNull Executor executor) Builds, computing a hash based on the provided URL.The hash computation will perform a network request asynchronously, exposing the completed info via the returned future.
- Parameters:
executor
- the executor to perform the hash computation on- Returns:
- a future providing the new resource pack request
- Since:
- 4.15.0
-
asResourcePackInfo
Description copied from interface:ResourcePackInfoLike
Gets aResourcePackInfo
representation.- Specified by:
asResourcePackInfo
in interfaceResourcePackInfoLike
- Returns:
- a component
-