Skip to content

Commit

Permalink
Hopefully fix mineskin api stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
libraryaddict committed Feb 24, 2025
1 parent 1032a2c commit 9a2ae0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static void write(ByteArrayOutputStream output, PrintWriter writer, String bound
private final ReentrantLock lock = new ReentrantLock();
@Getter
@Setter
private boolean debugging;
private boolean debugging = LibsDisguises.getInstance() == null;
@Getter
@Setter
private String apiKey;
Expand All @@ -128,7 +128,9 @@ public MineSkinAPI(String extraInfo) {
}
}

userAgent = "LibsDisguises/" + LibsDisguises.getInstance().getDescription().getVersion() + extraInfo;
String version = LibsDisguises.getInstance() == null ? "Not-LD-Itself" : LibsDisguises.getInstance().getDescription().getVersion();

userAgent = "LibsDisguises/" + version + extraInfo;
}

public boolean hasApiKey() {
Expand Down Expand Up @@ -287,7 +289,7 @@ private MineSkinQueueResponse readResponse(HttpURLConnection connection, SkinUti
}

private MineSkinQueueResponse getJobStatus(String jobId, SkinUtils.SkinCallback callback) throws IOException {
URL url = new URL("https://api.mineskin.org/v2/queue/:" + jobId);
URL url = new URL("https://api.mineskin.org/v2/queue/" + jobId);
// Creating a connection
HttpURLConnection con = (HttpURLConnection) url.openConnection();
addConnectionHeaders(con);
Expand Down Expand Up @@ -414,7 +416,7 @@ private MineSkinQueueResponse doPost(SkinUtils.SkinCallback callback, MineSkinSu
ex2.printStackTrace();
}

if (LibsDisguises.getInstance().getLogger() != null) {
if (LibsDisguises.getInstance() != null && LibsDisguises.getInstance().getLogger() != null) {
LibsDisguises.getInstance().getLogger().warning("Failed to access MineSkin.org");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,10 @@ public String get(Object... strings) {
}

public String toString() {
if (LibsDisguises.getInstance() == null) {
return name();
}

throw new IllegalStateException("Dont call this");
}
}

0 comments on commit 9a2ae0a

Please # to comment.