fancynpcs: Check if mojang api response code is 2xx

This commit is contained in:
Oliver
2025-07-03 20:22:45 +02:00
parent a8e87679ac
commit 56d0201a13
2 changed files with 2 additions and 2 deletions

View File

@@ -1 +1 @@
2.6.0.278 2.6.0.279

View File

@@ -35,7 +35,7 @@ public class MojangAPI {
.build(); .build();
HttpResponse<String> resp = client.send(request, HttpResponse.BodyHandlers.ofString()); HttpResponse<String> resp = client.send(request, HttpResponse.BodyHandlers.ofString());
if (resp.statusCode() != 200) { if (resp.statusCode() < 200 || resp.statusCode() >= 300) {
FancyNpcsPlugin.get().getFancyLogger().warn("Failed to fetch skin from Mojang API for " + uuid + " (status code: " + resp.statusCode() + ")"); FancyNpcsPlugin.get().getFancyLogger().warn("Failed to fetch skin from Mojang API for " + uuid + " (status code: " + resp.statusCode() + ")");
FancyNpcsPlugin.get().getFancyLogger().debug("Body: " + resp.body()); FancyNpcsPlugin.get().getFancyLogger().debug("Body: " + resp.body());
return null; return null;