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:
Ursprung
9ddfdf9374
Commit
90c4ea78a7
@ -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) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren