1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-30 12:19:10 +00:00

Don't throw errors when loading chunks with invalid skulls (#4081)

* Don't throw errors with invalid skulls

* Move IllegalArgumentException check to loadFromJson() method
This commit is contained in:
chris
2023-08-24 23:32:25 +02:00
committed by GitHub
parent 9ddfdf9374
commit 90c4ea78a7

View File

@@ -278,7 +278,14 @@ public class SkinManager {
}
public static GameProfileData loadFromJson(String encodedJson) throws IOException, IllegalArgumentException {
JsonNode skinObject = GeyserImpl.JSON_MAPPER.readTree(new String(Base64.getDecoder().decode(encodedJson), StandardCharsets.UTF_8));
JsonNode skinObject;
try {
skinObject = GeyserImpl.JSON_MAPPER.readTree(new String(Base64.getDecoder().decode(encodedJson), StandardCharsets.UTF_8));
} catch (IllegalArgumentException e) {
GeyserImpl.getInstance().getLogger().debug("Invalid base64 encoded skin entry: " + encodedJson);
return null;
}
JsonNode textures = skinObject.get("textures");
if (textures == null) {