diff --git a/EpicSpawners-API/src/main/java/com/craftaro/epicspawners/api/utils/HeadUtils.java b/EpicSpawners-API/src/main/java/com/craftaro/epicspawners/api/utils/HeadUtils.java index ef53c48..d198c47 100644 --- a/EpicSpawners-API/src/main/java/com/craftaro/epicspawners/api/utils/HeadUtils.java +++ b/EpicSpawners-API/src/main/java/com/craftaro/epicspawners/api/utils/HeadUtils.java @@ -1,12 +1,12 @@ package com.craftaro.epicspawners.api.utils; import com.craftaro.core.utils.HeadType; -import com.craftaro.third_party.com.cryptomorin.xseries.SkullUtils; -import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.epicspawners.api.spawners.spawner.SpawnerData; import com.craftaro.epicspawners.api.spawners.spawner.SpawnerTier; +import com.craftaro.third_party.com.cryptomorin.xseries.profiles.builder.XSkull; +import com.craftaro.third_party.com.cryptomorin.xseries.profiles.objects.ProfileInputType; +import com.craftaro.third_party.com.cryptomorin.xseries.profiles.objects.Profileable; import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.SkullMeta; import java.util.EnumMap; import java.util.Map; @@ -34,13 +34,7 @@ public class HeadUtils { } private static ItemStack createSkullForSkinHash(String textureHash) { - ItemStack head = XMaterial.PLAYER_HEAD.parseItem(); - - SkullMeta meta = (SkullMeta) head.getItemMeta(); - SkullUtils.applySkin(meta, textureHash); - head.setItemMeta(meta); - - return head; + return XSkull.createItem().profile(new Profileable.StringProfileable(textureHash, ProfileInputType.TEXTURE_HASH)).apply(); } private static HeadType getHeadTypeOrDefault(String name) { diff --git a/EpicSpawners-Plugin/src/main/java/com/craftaro/epicspawners/gui/SpawnerBoostGui.java b/EpicSpawners-Plugin/src/main/java/com/craftaro/epicspawners/gui/SpawnerBoostGui.java index 221d006..c9adb4e 100644 --- a/EpicSpawners-Plugin/src/main/java/com/craftaro/epicspawners/gui/SpawnerBoostGui.java +++ b/EpicSpawners-Plugin/src/main/java/com/craftaro/epicspawners/gui/SpawnerBoostGui.java @@ -5,31 +5,28 @@ import com.craftaro.core.database.DataManager; import com.craftaro.core.gui.CustomizableGui; import com.craftaro.core.gui.GuiUtils; import com.craftaro.core.hooks.EconomyManager; -import com.craftaro.third_party.com.cryptomorin.xseries.SkullUtils; -import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; -import com.craftaro.third_party.com.cryptomorin.xseries.XSound; -import com.craftaro.third_party.org.apache.commons.lang3.math.NumberUtils; -import com.craftaro.third_party.org.apache.commons.text.WordUtils; -import com.craftaro.third_party.org.jooq.Record; -import com.craftaro.third_party.org.jooq.Result; -import com.craftaro.third_party.org.jooq.impl.DSL; -import com.craftaro.core.utils.ItemUtils; import com.craftaro.core.utils.TextUtils; import com.craftaro.epicspawners.EpicSpawners; import com.craftaro.epicspawners.api.spawners.spawner.PlacedSpawner; import com.craftaro.epicspawners.boost.types.BoostedSpawnerImpl; import com.craftaro.epicspawners.settings.Settings; -import com.craftaro.ultimatestacker.api.stack.item.ItemMergeCallback; +import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.third_party.com.cryptomorin.xseries.XSound; +import com.craftaro.third_party.com.cryptomorin.xseries.profiles.builder.XSkull; +import com.craftaro.third_party.com.cryptomorin.xseries.profiles.objects.ProfileInputType; +import com.craftaro.third_party.com.cryptomorin.xseries.profiles.objects.Profileable; +import com.craftaro.third_party.org.apache.commons.lang3.math.NumberUtils; +import com.craftaro.third_party.org.apache.commons.text.WordUtils; +import com.craftaro.third_party.org.jooq.Record; +import com.craftaro.third_party.org.jooq.Result; +import com.craftaro.third_party.org.jooq.impl.DSL; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; -import org.checkerframework.checker.nullness.qual.NonNull; import java.util.Calendar; import java.util.Date; -import java.util.Objects; public class SpawnerBoostGui extends CustomizableGui { private final EpicSpawners plugin; @@ -111,11 +108,8 @@ public class SpawnerBoostGui extends CustomizableGui { }); if (this.amount < Settings.MAX_PLAYER_BOOST.getInt()) { - ItemStack head = Objects.requireNonNull(XMaterial.PLAYER_HEAD.parseItem()); + ItemStack head = XSkull.createItem().profile(new Profileable.StringProfileable("19bf3292e126a105b54eba713aa1b152d541a1d8938829c56364d178ed22bf", ProfileInputType.TEXTURE_HASH)).apply(); AdventureUtils.formatItemName(head, "&6&l+1"); - ItemMeta meta = head.getItemMeta(); - SkullUtils.applySkin(meta, "19bf3292e126a105b54eba713aa1b152d541a1d8938829c56364d178ed22bf"); - head.setItemMeta(meta); setButton("plus1", 8, head, event -> { this.amount++;