mirror of
https://github.com/Suiranoil/SkinRestorer.git
synced 2026-01-16 04:42:12 +00:00
update mineskin client to 3.0.6
This commit is contained in:
@@ -32,8 +32,8 @@ public class Java11RequestHandler extends RequestHandler {
|
|||||||
private final Gson gson;
|
private final Gson gson;
|
||||||
private final HttpClient httpClient;
|
private final HttpClient httpClient;
|
||||||
|
|
||||||
public Java11RequestHandler(String userAgent, String apiKey, int timeout, Gson gson, InetSocketAddress proxy) {
|
public Java11RequestHandler(String baseUrl, String userAgent, String apiKey, int timeout, Gson gson, InetSocketAddress proxy) {
|
||||||
super(userAgent, apiKey, timeout, gson);
|
super(baseUrl, userAgent, apiKey, timeout, gson);
|
||||||
this.gson = gson;
|
this.gson = gson;
|
||||||
|
|
||||||
HttpClient.Builder clientBuilder = HttpClient.newBuilder()
|
HttpClient.Builder clientBuilder = HttpClient.newBuilder()
|
||||||
@@ -85,6 +85,7 @@ public class Java11RequestHandler extends RequestHandler {
|
|||||||
|
|
||||||
public <T, R extends MineSkinResponse<T>> R getJson(String url, Class<T> clazz, ResponseConstructor<T, R> constructor)
|
public <T, R extends MineSkinResponse<T>> R getJson(String url, Class<T> clazz, ResponseConstructor<T, R> constructor)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
url = this.baseUrl + url;
|
||||||
MineSkinClientImpl.LOGGER.fine("GET " + url);
|
MineSkinClientImpl.LOGGER.fine("GET " + url);
|
||||||
|
|
||||||
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
|
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
|
||||||
@@ -110,6 +111,7 @@ public class Java11RequestHandler extends RequestHandler {
|
|||||||
|
|
||||||
public <T, R extends MineSkinResponse<T>> R postJson(String url, JsonObject data, Class<T> clazz, ResponseConstructor<T, R> constructor)
|
public <T, R extends MineSkinResponse<T>> R postJson(String url, JsonObject data, Class<T> clazz, ResponseConstructor<T, R> constructor)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
url = this.baseUrl + url;
|
||||||
MineSkinClientImpl.LOGGER.fine("POST " + url);
|
MineSkinClientImpl.LOGGER.fine("POST " + url);
|
||||||
|
|
||||||
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
|
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
|
||||||
@@ -137,6 +139,7 @@ public class Java11RequestHandler extends RequestHandler {
|
|||||||
|
|
||||||
public <T, R extends MineSkinResponse<T>> R postFormDataFile(String url, String key, String filename, InputStream in, Map<String, String> data, Class<T> clazz, ResponseConstructor<T, R> constructor)
|
public <T, R extends MineSkinResponse<T>> R postFormDataFile(String url, String key, String filename, InputStream in, Map<String, String> data, Class<T> clazz, ResponseConstructor<T, R> constructor)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
url = this.baseUrl + url;
|
||||||
MineSkinClientImpl.LOGGER.fine("POST " + url);
|
MineSkinClientImpl.LOGGER.fine("POST " + url);
|
||||||
|
|
||||||
String boundary = "mineskin-" + System.currentTimeMillis();
|
String boundary = "mineskin-" + System.currentTimeMillis();
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ public final class MineskinSkinProvider implements SkinProvider {
|
|||||||
.userAgent(WebUtils.USER_AGENT)
|
.userAgent(WebUtils.USER_AGENT)
|
||||||
.gson(JsonUtils.GSON)
|
.gson(JsonUtils.GSON)
|
||||||
.timeout((int) Duration.ofSeconds(config.requestTimeout()).toMillis())
|
.timeout((int) Duration.ofSeconds(config.requestTimeout()).toMillis())
|
||||||
.requestHandler((userAgent, apiKey, timeout, gson) -> new Java11RequestHandler(
|
.requestHandler((baseUrl, userAgent, apiKey, timeout, gson) -> new Java11RequestHandler(
|
||||||
|
baseUrl,
|
||||||
userAgent,
|
userAgent,
|
||||||
apiKey,
|
apiKey,
|
||||||
timeout,
|
timeout,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ credits=
|
|||||||
description=A server-side mod for managing skins.
|
description=A server-side mod for managing skins.
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
mineskin_client_version=3.0.1-SNAPSHOT
|
mineskin_client_version=3.0.6-SNAPSHOT
|
||||||
|
|
||||||
# ParchmentMC mappings, see https://parchmentmc.org/docs/getting-started#choose-a-version for new versions
|
# ParchmentMC mappings, see https://parchmentmc.org/docs/getting-started#choose-a-version for new versions
|
||||||
parchment_minecraft=1.21.5
|
parchment_minecraft=1.21.5
|
||||||
|
|||||||
Reference in New Issue
Block a user