Skip to content

Commit 838b9b6

Browse files
committed
Fallback to SteveSkin on skin errors
1 parent e8e7e29 commit 838b9b6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

plugin/src/main/java/com/iridium/iridiumcore/utils/ItemStackUtils.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import com.cryptomorin.xseries.XMaterial;
44
import com.cryptomorin.xseries.profiles.builder.XSkull;
5+
import com.cryptomorin.xseries.profiles.exceptions.InvalidProfileException;
6+
import com.cryptomorin.xseries.profiles.exceptions.ProfileChangeException;
57
import com.cryptomorin.xseries.profiles.objects.Profileable;
68
import com.cryptomorin.xseries.reflection.XReflection;
79
import com.iridium.iridiumcore.IridiumCore;
@@ -72,7 +74,11 @@ public static ItemStack makeItem(Item item, List<Placeholder> placeholders) {
7274
skullData = SkinUtils.getHeadData(SkinUtils.getUUID(skullData));
7375
}
7476

75-
itemStack = XSkull.of(itemStack).profile(Profileable.detect(skullData)).apply();
77+
try {
78+
itemStack = XSkull.of(itemStack).profile(Profileable.detect(skullData)).apply();
79+
}catch (ProfileChangeException | InvalidProfileException e){
80+
itemStack = XSkull.of(itemStack).profile(Profileable.detect(SkinUtils.steveSkin)).apply();
81+
}
7682
}
7783

7884
return itemStack;

plugin/src/main/java/com/iridium/iridiumcore/utils/SkinUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class SkinUtils {
2222

2323
private static final UUID loadingUUID = UUID.randomUUID();
2424

25-
private static final String steveSkin = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWI3YWY5ZTQ0MTEyMTdjN2RlOWM2MGFjYmQzYzNmZDY1MTk3ODMzMzJhMWIzYmM1NmZiZmNlOTA3MjFlZjM1In19fQ==";
25+
public static final String steveSkin = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWI3YWY5ZTQ0MTEyMTdjN2RlOWM2MGFjYmQzYzNmZDY1MTk3ODMzMzJhMWIzYmM1NmZiZmNlOTA3MjFlZjM1In19fQ==";
2626

2727
public static UUID getUUID(String username) {
2828
if (!uuidCache.containsKey(username)) {

0 commit comments

Comments
 (0)