mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-05 23:33:36 +00:00
fancynpcs: Check if mojang api response code is 2xx
This commit is contained in:
@@ -1 +1 @@
|
||||
2.6.0.278
|
||||
2.6.0.279
|
||||
@@ -35,7 +35,7 @@ public class MojangAPI {
|
||||
.build();
|
||||
|
||||
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().debug("Body: " + resp.body());
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user