diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/profess/PlayerClass.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/profess/PlayerClass.java index a593074d..03bc5861 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/profess/PlayerClass.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/profess/PlayerClass.java @@ -40,6 +40,7 @@ import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.inventory.meta.SkullMeta; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -89,7 +90,7 @@ public class PlayerClass extends PostLoadObject implements ExperienceObject { if (config.contains("display.texture") && icon.getType() == VersionMaterial.PLAYER_HEAD.toMaterial()) { ItemMeta meta = icon.getItemMeta(); - UtilityMethods.setTextureValue(meta, config.getString("display.texture")); + UtilityMethods.setTextureValue((SkullMeta) meta, config.getString("display.texture")); icon.setItemMeta(meta); } diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/api/item/InventoryItem.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/api/item/InventoryItem.java index 41a49334..56a53aa6 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/api/item/InventoryItem.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/api/item/InventoryItem.java @@ -147,7 +147,7 @@ public abstract class InventoryItem { final ItemMeta meta = item.getItemMeta(); meta.setCustomModelData(modelData); if (texture != null && meta instanceof SkullMeta) - UtilityMethods.setTextureValue(meta, texture); + UtilityMethods.setTextureValue((SkullMeta) meta, texture); if (hasName()) meta.setDisplayName(placeholders.apply(effectivePlayer, getName())); diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/util/item/AbstractItemBuilder.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/util/item/AbstractItemBuilder.java index f9731368..78b54143 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/util/item/AbstractItemBuilder.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/util/item/AbstractItemBuilder.java @@ -10,10 +10,10 @@ import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.Damageable; import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.inventory.meta.SkullMeta; import org.jetbrains.annotations.NotNull; import java.util.*; -import java.util.logging.Level; public abstract class AbstractItemBuilder { private final ConfigItem configItem; @@ -42,11 +42,7 @@ public abstract class AbstractItemBuilder { ItemMeta meta = item.getItemMeta(); if (item.getType() == VersionMaterial.PLAYER_HEAD.toMaterial() && configItem.getTexture() != null) - try { - UtilityMethods.setTextureValue(meta, configItem.getTexture()); - } catch (IllegalArgumentException exception) { - MMOCore.log(Level.WARNING, "Could not load texture of config item called '" + configItem.getId() + "'"); - } + UtilityMethods.setTextureValue((SkullMeta) meta, configItem.getTexture()); meta.addItemFlags(ItemFlag.values()); meta.setDisplayName(applyPlaceholders(configItem.getName()));