Put a try catch around head getting #2464

This commit is contained in:
tastybento 2024-08-11 16:20:20 -07:00
parent ed700a1915
commit 3c29f88d23

View File

@ -68,9 +68,7 @@ public class HeadCache
* @param timestamp of type long * @param timestamp of type long
*/ */
public HeadCache(String userName, public HeadCache(String userName,
UUID userId, UUID userId, PlayerProfile playerProfile, long timestamp)
PlayerProfile playerProfile,
long timestamp)
{ {
this.userName = userName; this.userName = userName;
this.playerProfile = playerProfile; this.playerProfile = playerProfile;
@ -99,8 +97,12 @@ public class HeadCache
// Set correct Skull texture // Set correct Skull texture
if (meta != null && this.playerProfile != null) if (meta != null && this.playerProfile != null)
{ {
meta.setOwnerProfile(this.playerProfile); try {
item.setItemMeta(meta); meta.setOwnerProfile(this.playerProfile);
item.setItemMeta(meta);
} catch (Exception e) {
// Do nothing - there was an error getting the head
}
} }
return item; return item;