fix: use the Core's SkullItemCreator instead of XSeries's XSkull

The class should fix a couple of issues players have been reporting,
This commit is contained in:
Christian Koop 2024-09-23 10:22:20 +02:00
parent 15b9426f78
commit ee98394e0b
No known key found for this signature in database
GPG Key ID: 6A4A09E8ED946113
2 changed files with 5 additions and 10 deletions

View File

@ -1,11 +1,9 @@
package com.craftaro.epicspawners.api.utils;
import com.craftaro.core.utils.HeadType;
import com.craftaro.core.utils.SkullItemCreator;
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 java.util.EnumMap;
@ -33,8 +31,8 @@ public class HeadUtils {
return createSkullForSkinHash(headType.getUrlHash());
}
private static ItemStack createSkullForSkinHash(String textureHash) {
return XSkull.createItem().profile(new Profileable.StringProfileable(textureHash, ProfileInputType.TEXTURE_HASH)).apply();
private static ItemStack createSkullForSkinHash(String textureUrlHash) {
return SkullItemCreator.byTextureUrlHash(textureUrlHash);
}
private static HeadType getHeadTypeOrDefault(String name) {

View File

@ -5,6 +5,7 @@ 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.core.utils.SkullItemCreator;
import com.craftaro.core.utils.TextUtils;
import com.craftaro.epicspawners.EpicSpawners;
import com.craftaro.epicspawners.api.spawners.spawner.PlacedSpawner;
@ -12,9 +13,6 @@ import com.craftaro.epicspawners.boost.types.BoostedSpawnerImpl;
import com.craftaro.epicspawners.settings.Settings;
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;
@ -25,7 +23,6 @@ import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
@ -111,7 +108,7 @@ public class SpawnerBoostGui extends CustomizableGui {
});
if (this.amount < Settings.MAX_PLAYER_BOOST.getInt()) {
ItemStack head = XSkull.createItem().profile(new Profileable.StringProfileable("19bf3292e126a105b54eba713aa1b152d541a1d8938829c56364d178ed22bf", ProfileInputType.TEXTURE_HASH)).apply();
ItemStack head = SkullItemCreator.byTextureUrlHash("19bf3292e126a105b54eba713aa1b152d541a1d8938829c56364d178ed22bf");
AdventureUtils.formatItemName(head, "&6&l+1");
setButton("plus1", 8, head, event -> {