Update getPlayerHead to use offlineplayerdata
This commit is contained in:
parent
2b07c9807b
commit
0a4de42fea
|
|
@ -11,6 +11,7 @@ import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
|
|
@ -146,8 +147,9 @@ public class ShopUtil {
|
||||||
public static ItemStack getPlayerHead(UUID uuid) {
|
public static ItemStack getPlayerHead(UUID uuid) {
|
||||||
ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
|
ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
|
||||||
|
|
||||||
Player player = Bukkit.getPlayer(uuid);
|
OfflinePlayer player = Bukkit.getOfflinePlayer(uuid);
|
||||||
if (player == null) return skull;
|
if (!player.hasPlayedBefore())
|
||||||
|
return skull;
|
||||||
|
|
||||||
// TODO add skins to skulls and name them.
|
// TODO add skins to skulls and name them.
|
||||||
SkullMeta meta = (SkullMeta) skull.getItemMeta();
|
SkullMeta meta = (SkullMeta) skull.getItemMeta();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user