Add failed back to skin

This commit is contained in:
rtm516 2024-03-17 21:20:46 +00:00
parent f490d84958
commit eade61c428
No known key found for this signature in database
GPG Key ID: 331715B8B007C67A
4 changed files with 11 additions and 5 deletions

View File

@ -26,4 +26,7 @@
package org.geysermc.geyser.api.skin;
public record Cape(String textureUrl, String capeId, byte[] capeData, boolean failed) {
public Cape(String textureUrl, String capeId, byte[] capeData) {
this(textureUrl, capeId, capeData, false);
}
}

View File

@ -25,5 +25,8 @@
package org.geysermc.geyser.api.skin;
public record Skin(String textureUrl, byte[] skinData) {
public record Skin(String textureUrl, byte[] skinData, boolean failed) {
public Skin(String textureUrl, byte[] skinData) {
this(textureUrl, skinData, false);
}
}

View File

@ -95,7 +95,7 @@ public final class ProvidedSkins {
image.flush();
String identifier = "geysermc:" + assetName + "_" + (slim ? "slim" : "wide");
this.data = new Skin(identifier, byteData);
this.data = new Skin(identifier, byteData, true);
} catch (IOException e) {
e.printStackTrace();
}

View File

@ -115,7 +115,7 @@ public class SkinProvider {
outputStream.write((rgba >> 24) & 0xFF); // Alpha
}
}
EMPTY_SKIN = new Skin("geysermc:empty", outputStream.toByteArray());
EMPTY_SKIN = new Skin("geysermc:empty", outputStream.toByteArray(), true);
/* Load in the custom skull geometry */
String skullData = new String(FileUtils.readAllBytes("bedrock/skin/geometry.humanoid.customskull.json"), StandardCharsets.UTF_8);
@ -366,7 +366,7 @@ public class SkinProvider {
}
static void storeBedrockCape(String capeId, byte[] capeData) {
Cape cape = new Cape(capeId, capeId, capeData, false);
Cape cape = new Cape(capeId, capeId, capeData);
CACHED_BEDROCK_CAPES.put(capeId, cape);
}
@ -381,7 +381,7 @@ public class SkinProvider {
return new Skin(textureUrl, skin);
} catch (Exception ignored) {} // just ignore I guess
return new Skin("empty", EMPTY_SKIN.skinData());
return new Skin("empty", EMPTY_SKIN.skinData(), true);
}
private static Cape supplyCape(String capeUrl, CapeProvider provider) {