3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-20 06:50:09 +01: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
Dieser Commit ist enthalten in:
chris 2023-08-24 23:32:25 +02:00 committet von GitHub
Ursprung 9ddfdf9374
Commit 90c4ea78a7
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -278,7 +278,14 @@ public class SkinManager {
} }
public static GameProfileData loadFromJson(String encodedJson) throws IOException, IllegalArgumentException { 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"); JsonNode textures = skinObject.get("textures");
if (textures == null) { if (textures == null) {