Skip to content

Commit

Permalink
[Layout] Add debug messages when a skin is about to be downloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
NEZNAMY committed Jan 16, 2025
1 parent 9500bab commit 09891a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ public Skin download(@NotNull String input) {
} catch (NumberFormatException ex) {
type = "uuid";
}
JSONObject json = getResponse("https://api.mineskin.org/get/" + type + "/" + input);
String url = "https://api.mineskin.org/get/" + type + "/" + input;
TAB.getInstance().debug("Downloading skin from " + url);
JSONObject json = getResponse(url);
JSONObject data = (JSONObject) json.get("data");
JSONObject texture = (JSONObject) data.get("texture");
String value = (String) texture.get("value");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ protected PlayerSkin(@NotNull ConfigurationFile file) {
@Nullable
public Skin download(@NotNull String input) {
try {
JSONObject json = getResponse("https://api.ashcon.app/mojang/v2/user/" + input);
String url = "https://api.ashcon.app/mojang/v2/user/" + input;
TAB.getInstance().debug("Downloading skin from " + url);
JSONObject json = getResponse(url);
JSONObject textures = (JSONObject) json.get("textures");
JSONObject raw = (JSONObject) textures.get("raw");
String value = (String) raw.get("value");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public Skin download(@NotNull String texture) {

@NotNull
private static InputStreamReader getInputStreamReader(@NotNull String texture) throws IOException {
TAB.getInstance().debug("Downloading skin from https://textures.minecraft.net/texture/" + texture);
URL url = new URL("https://api.mineskin.org/generate/url/");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestProperty("User-Agent", "ExampleApp/v1.0");
Expand Down

0 comments on commit 09891a0

Please sign in to comment.