forked from GeyserMC/Geyser
Only notify debuggers that parsing GameProfile data failed and use the default skin and cape
This commit is contained in:
parent
46cb14fc0a
commit
0e97e52337
1 changed files with 18 additions and 12 deletions
|
@ -67,6 +67,7 @@ public class SkinUtils {
|
|||
private boolean alex;
|
||||
|
||||
public static GameProfileData from(GameProfile profile) {
|
||||
try {
|
||||
GameProfile.Property skinProperty = profile.getProperty("textures");
|
||||
|
||||
JsonObject skinObject = SkinProvider.GSON.fromJson(new String(Base64.getDecoder().decode(skinProperty.getValue()), Charsets.UTF_8), JsonObject.class);
|
||||
|
@ -84,6 +85,11 @@ public class SkinUtils {
|
|||
}
|
||||
|
||||
return new GameProfileData(skinUrl, capeUrl, isAlex);
|
||||
} catch (Exception exception) {
|
||||
// return default skin with default cape when texture data is invalid
|
||||
Geyser.getLogger().debug("Got invalid texture data for " + profile.getName() + " " + exception.getMessage());
|
||||
return new GameProfileData("", "", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue