Package net.kyori.adventure.resource
Interface ResourcePackRequest.Builder
-
- All Superinterfaces:
AbstractBuilder<ResourcePackRequest>
,ResourcePackRequestLike
- Enclosing interface:
- ResourcePackRequest
public static interface ResourcePackRequest.Builder extends AbstractBuilder<ResourcePackRequest>, ResourcePackRequestLike
A builder for resource pack requests.- Since:
- 4.15.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default @NotNull ResourcePackRequest
asResourcePackRequest()
Get the pack request representation.@NotNull ResourcePackRequest.Builder
callback(@NotNull ResourcePackCallback cb)
Set the callback to respond to resource pack application status events.@NotNull ResourcePackRequest.Builder
packs(@NotNull java.lang.Iterable<? extends ResourcePackInfoLike> packs)
Set the resource packs to apply.@NotNull ResourcePackRequest.Builder
packs(@NotNull ResourcePackInfoLike first, @NotNull ResourcePackInfoLike @NotNull ... others)
Set the resource packs to apply.@NotNull ResourcePackRequest.Builder
prompt(@Nullable Component prompt)
Sets the prompt.@NotNull ResourcePackRequest.Builder
replace(boolean replace)
Set whether to replace or add to existing resource packs.@NotNull ResourcePackRequest.Builder
required(boolean required)
Sets whether the resource pack is required or not.-
Methods inherited from interface net.kyori.adventure.builder.AbstractBuilder
build
-
-
-
-
Method Detail
-
packs
@Contract("_, _ -> this") @NotNull @NotNull ResourcePackRequest.Builder packs(@NotNull @NotNull ResourcePackInfoLike first, @NotNull @NotNull ResourcePackInfoLike @NotNull ... others)
Set the resource packs to apply.- Parameters:
first
- the first pack to applyothers
- additional packs to apply- Returns:
- this builder
- Since:
- 4.15.0
-
packs
@Contract("_ -> this") @NotNull @NotNull ResourcePackRequest.Builder packs(@NotNull @NotNull java.lang.Iterable<? extends ResourcePackInfoLike> packs)
Set the resource packs to apply.- Parameters:
packs
- the packs to apply- Returns:
- this builder
- Since:
- 4.15.0
-
callback
@Contract("_ -> this") @NotNull @NotNull ResourcePackRequest.Builder callback(@NotNull @NotNull ResourcePackCallback cb)
Set the callback to respond to resource pack application status events.- Parameters:
cb
- the callback- Returns:
- this builder
- Since:
- 4.15.0
-
replace
@Contract("_ -> this") @NotNull @NotNull ResourcePackRequest.Builder replace(boolean replace)
Set whether to replace or add to existing resource packs.- Parameters:
replace
- whether to replace existing server packs- Returns:
- this builder
- Since:
- 4.15.0
-
required
@Contract("_ -> this") @NotNull @NotNull ResourcePackRequest.Builder required(boolean required)
Sets whether the resource pack is required or not.Vanilla clients will disconnect themselves if their player rejects a required pack, but implementations will not necessarily perform any additional serverside validation. The
ResourcePackRequest.callback()
can provide more information about the client's reaction.- Parameters:
required
- whether the resource pack is required or not- Returns:
- this builder
- Since:
- 4.15.0
-
prompt
@Contract("_ -> this") @NotNull @NotNull ResourcePackRequest.Builder prompt(@Nullable @Nullable Component prompt)
Sets the prompt.- Parameters:
prompt
- the prompt- Returns:
- this builder
- Since:
- 4.15.0
-
asResourcePackRequest
@NotNull default @NotNull ResourcePackRequest asResourcePackRequest()
Description copied from interface:ResourcePackRequestLike
Get the pack request representation.- Specified by:
asResourcePackRequest
in interfaceResourcePackRequestLike
- Returns:
- the pack request representation of this object
-
-