mirror of
https://github.com/craftaro/EpicSpawners.git
synced 2025-01-08 11:37:51 +08:00
fix: replace usage of deleted SkullUtils class with XSkull
Updating the Core also updated XSeries which got rid of SkullUtils in favor of new methods in XSkull
This commit is contained in:
parent
65ed424163
commit
0d5d4eb3a4
@ -1,12 +1,12 @@
|
|||||||
package com.craftaro.epicspawners.api.utils;
|
package com.craftaro.epicspawners.api.utils;
|
||||||
|
|
||||||
import com.craftaro.core.utils.HeadType;
|
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.SpawnerData;
|
||||||
import com.craftaro.epicspawners.api.spawners.spawner.SpawnerTier;
|
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.ItemStack;
|
||||||
import org.bukkit.inventory.meta.SkullMeta;
|
|
||||||
|
|
||||||
import java.util.EnumMap;
|
import java.util.EnumMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -34,13 +34,7 @@ public class HeadUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static ItemStack createSkullForSkinHash(String textureHash) {
|
private static ItemStack createSkullForSkinHash(String textureHash) {
|
||||||
ItemStack head = XMaterial.PLAYER_HEAD.parseItem();
|
return XSkull.createItem().profile(new Profileable.StringProfileable(textureHash, ProfileInputType.TEXTURE_HASH)).apply();
|
||||||
|
|
||||||
SkullMeta meta = (SkullMeta) head.getItemMeta();
|
|
||||||
SkullUtils.applySkin(meta, textureHash);
|
|
||||||
head.setItemMeta(meta);
|
|
||||||
|
|
||||||
return head;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static HeadType getHeadTypeOrDefault(String name) {
|
private static HeadType getHeadTypeOrDefault(String name) {
|
||||||
|
@ -5,31 +5,28 @@ import com.craftaro.core.database.DataManager;
|
|||||||
import com.craftaro.core.gui.CustomizableGui;
|
import com.craftaro.core.gui.CustomizableGui;
|
||||||
import com.craftaro.core.gui.GuiUtils;
|
import com.craftaro.core.gui.GuiUtils;
|
||||||
import com.craftaro.core.hooks.EconomyManager;
|
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.core.utils.TextUtils;
|
||||||
import com.craftaro.epicspawners.EpicSpawners;
|
import com.craftaro.epicspawners.EpicSpawners;
|
||||||
import com.craftaro.epicspawners.api.spawners.spawner.PlacedSpawner;
|
import com.craftaro.epicspawners.api.spawners.spawner.PlacedSpawner;
|
||||||
import com.craftaro.epicspawners.boost.types.BoostedSpawnerImpl;
|
import com.craftaro.epicspawners.boost.types.BoostedSpawnerImpl;
|
||||||
import com.craftaro.epicspawners.settings.Settings;
|
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.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
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.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class SpawnerBoostGui extends CustomizableGui {
|
public class SpawnerBoostGui extends CustomizableGui {
|
||||||
private final EpicSpawners plugin;
|
private final EpicSpawners plugin;
|
||||||
@ -111,11 +108,8 @@ public class SpawnerBoostGui extends CustomizableGui {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (this.amount < Settings.MAX_PLAYER_BOOST.getInt()) {
|
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");
|
AdventureUtils.formatItemName(head, "&6&l+1");
|
||||||
ItemMeta meta = head.getItemMeta();
|
|
||||||
SkullUtils.applySkin(meta, "19bf3292e126a105b54eba713aa1b152d541a1d8938829c56364d178ed22bf");
|
|
||||||
head.setItemMeta(meta);
|
|
||||||
|
|
||||||
setButton("plus1", 8, head, event -> {
|
setButton("plus1", 8, head, event -> {
|
||||||
this.amount++;
|
this.amount++;
|
||||||
|
Loading…
Reference in New Issue
Block a user