ResourcePackRequestHandler instead@Deprecated @ApiStatus.ScheduledForRemoval(inVersion="2.0.0") @FunctionalInterface public interface ResourcePackRequestHandler extends ResourcePackRequestHandler
| Modifier and Type | Method and Description |
|---|---|
static ResourcePackRequestHandler |
of(team.unnamed.creative.BuiltResourcePack pack)
Deprecated.
|
static ResourcePackRequestHandler |
of(team.unnamed.creative.BuiltResourcePack pack,
boolean validOnly)
Deprecated.
|
default void |
onException(java.lang.Exception e)
Deprecated.
Handles an unhandled exception when invoking
onRequest(team.unnamed.creative.server.ResourcePackRequest, com.sun.net.httpserver.HttpExchange) |
default void |
onInvalidRequest(com.sun.net.httpserver.HttpExchange exchange)
Deprecated.
Called when an invalid request is made, by default,
a simple message is sent
|
default void |
onRequest(@Nullable ResourcePackDownloadRequest request,
@NotNull com.sun.net.httpserver.HttpExchange exchange)
Deprecated.
Handles a resource pack request, the resulting resource
pack is written to
HttpExchange.getResponseBody() |
void |
onRequest(ResourcePackRequest request,
com.sun.net.httpserver.HttpExchange exchange)
Deprecated.
Handles a resource pack request, the resulting resource
pack is written to
HttpExchange.getResponseBody() |
fixed, fixedvoid onRequest(ResourcePackRequest request, com.sun.net.httpserver.HttpExchange exchange) throws java.io.IOException
HttpExchange.getResponseBody()
An "application/zip" Content-Type header should be set
when returning a resource-pack, HttpExchange.getResponseHeaders()
request - The resource pack requestexchange - The HTTP exchangejava.io.IOException - If writing the response failsHttpExchangedefault void onRequest(@Nullable
@Nullable ResourcePackDownloadRequest request,
@NotNull
@NotNull com.sun.net.httpserver.HttpExchange exchange)
throws java.io.IOException
ResourcePackRequestHandlerHttpExchange.getResponseBody()
An "application/zip" Content-Type header should be set
when returning a resource-pack, HttpExchange.getResponseHeaders()
onRequest in interface ResourcePackRequestHandlerrequest - The resource pack request, null means that the
request couldn't be parsed and the requester is
not a Minecraft clientexchange - The HTTP exchangejava.io.IOException - If writing the response failsHttpExchangedefault void onException(java.lang.Exception e)
onRequest(team.unnamed.creative.server.ResourcePackRequest, com.sun.net.httpserver.HttpExchange)e - The caught exceptiondefault void onInvalidRequest(com.sun.net.httpserver.HttpExchange exchange)
throws java.io.IOException
exchange - The http exchangejava.io.IOException - If writing the response failsHttpExchangestatic ResourcePackRequestHandler of(team.unnamed.creative.BuiltResourcePack pack, boolean validOnly)
static ResourcePackRequestHandler of(team.unnamed.creative.BuiltResourcePack pack)