Interface ResourcePackRequest.Builder
- All Superinterfaces:
AbstractBuilder<ResourcePackRequest>, ResourcePackRequestLike
- Enclosing interface:
ResourcePackRequest
public static sealed interface ResourcePackRequest.Builder
extends AbstractBuilder<ResourcePackRequest>, ResourcePackRequestLike
A builder for resource pack requests.
- Since:
- 4.15.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault ResourcePackRequestGet the pack request representation.Set the callback to respond to resource pack application status events.packs(Iterable<? extends ResourcePackInfoLike> packs) Set the resource packs to apply.packs(ResourcePackInfoLike first, ResourcePackInfoLike... others) Set the resource packs to apply.Sets the prompt.replace(boolean replace) Set whether to replace or add to existing resource packs.required(boolean required) Sets whether the resource pack is required or not.Methods inherited from interface AbstractBuilder
build
-
Method Details
-
packs
@Contract("_, _ -> this") ResourcePackRequest.Builder packs(ResourcePackInfoLike first, ResourcePackInfoLike... 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") ResourcePackRequest.Builder packs(Iterable<? extends ResourcePackInfoLike> packs) Set the resource packs to apply.- Parameters:
packs- the packs to apply- Returns:
- this builder
- Since:
- 4.15.0
-
callback
Set the callback to respond to resource pack application status events.- Parameters:
cb- the callback- Returns:
- this builder
- Since:
- 4.15.0
-
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
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
Sets the prompt.- Parameters:
prompt- the prompt- Returns:
- this builder
- Since:
- 4.15.0
-
asResourcePackRequest
Description copied from interface:ResourcePackRequestLikeGet the pack request representation.- Specified by:
asResourcePackRequestin interfaceResourcePackRequestLike- Returns:
- the pack request representation of this object
-