Interface ResourcePackRequest.Builder

    • 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 apply
        others - 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