aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/xmrvizzy/skyblocker/skyblock
diff options
context:
space:
mode:
authorAaron <51387595+AzureAaron@users.noreply.github.com>2023-09-17 11:47:16 -0400
committerAaron <51387595+AzureAaron@users.noreply.github.com>2023-09-17 11:47:16 -0400
commit0a60278fc03c71ed1b58f74eeecc27c5bc92a595 (patch)
tree8d71da6ae315872f753a369f6f1b9d44a80171e6 /src/main/java/me/xmrvizzy/skyblocker/skyblock
parent3445dda316253ff4b9c051825ee6fad11cc08254 (diff)
downloadSkyblocker-0a60278fc03c71ed1b58f74eeecc27c5bc92a595.tar.gz
Skyblocker-0a60278fc03c71ed1b58f74eeecc27c5bc92a595.tar.bz2
Skyblocker-0a60278fc03c71ed1b58f74eeecc27c5bc92a595.zip
Fix missing head textures (most of them)
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock')
-rw-r--r--src/main/java/me/xmrvizzy/skyblocker/skyblock/itemlist/ItemStackBuilder.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/itemlist/ItemStackBuilder.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/itemlist/ItemStackBuilder.java
index d420d54f..6884c7c1 100644
--- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/itemlist/ItemStackBuilder.java
+++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/itemlist/ItemStackBuilder.java
@@ -61,11 +61,12 @@ public class ItemStackBuilder {
String nbttag = obj.get("nbttag").getAsString();
// add skull texture
- Matcher skullMatcher = Pattern.compile("SkullOwner:\\{Id:\"(.{36})\",Properties:\\{textures:\\[0:\\{Value:\"(.+)\"}]}}").matcher(nbttag);
- if (skullMatcher.find()) {
+ Matcher skullUuid = Pattern.compile("(?:(?<=SkullOwner:\\{)Id:\"(.{36})\")").matcher(nbttag);
+ Matcher skullTexture = Pattern.compile("(?:(?<=Properties:\\{textures:\\[0:\\{Value:)\"(.+?)\")").matcher(nbttag);
+ if (skullUuid.find() && skullTexture.find()) {
NbtCompound skullOwner = new NbtCompound();
tag.put("SkullOwner", skullOwner);
- UUID uuid = UUID.fromString(skullMatcher.group(1));
+ UUID uuid = UUID.fromString(skullUuid.group(1));
skullOwner.put("Id", NbtHelper.fromUuid(uuid));
skullOwner.put("Name", NbtString.of(internalName));
@@ -75,7 +76,7 @@ public class ItemStackBuilder {
properties.put("textures", textures);
NbtCompound texture = new NbtCompound();
textures.add(texture);
- texture.put("Value", NbtString.of(skullMatcher.group(2)));
+ texture.put("Value", NbtString.of(skullTexture.group(1)));
}
// add leather armor dye color
Matcher colorMatcher = Pattern.compile("color:(\\d+)").matcher(nbttag);