From abfa779d70f5b45e15d8e158453e3b665792c136 Mon Sep 17 00:00:00 2001 From: TeamHR Date: Mon, 25 Mar 2024 23:08:29 +0530 Subject: [PATCH] [Fixed] /is members Was throwing NPE for Players --- .../java/com/craftaro/skyblock/menus/Members.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/craftaro/skyblock/menus/Members.java b/src/main/java/com/craftaro/skyblock/menus/Members.java index c29e0be2..f99b3396 100644 --- a/src/main/java/com/craftaro/skyblock/menus/Members.java +++ b/src/main/java/com/craftaro/skyblock/menus/Members.java @@ -398,12 +398,12 @@ public void open(Player player, Members.Type type, Members.Sort sort) { int islandPlaytime; - org.bukkit.OfflinePlayer targetPlayer = Bukkit.getServer().getOfflinePlayer(playerUUID); + Player targetPlayer = Bukkit.getServer().getPlayer(playerUUID); if (targetPlayer == null) { OfflinePlayer offlinePlayer = new OfflinePlayer(playerUUID); playerName = offlinePlayer.getName(); - playerTexture = offlinePlayer.getTexture(); + //playerTexture = offlinePlayer.getTexture(); islandPlaytime = offlinePlayer.getPlaytime(); playTimeDurationTime = NumberUtil.getDuration(Integer.valueOf(islandPlaytime)); @@ -419,8 +419,8 @@ public void open(Player player, Members.Type type, Members.Sort sort) { } else { playerName = targetPlayer.getName(); - playerData = plugin.getPlayerDataManager().getPlayerData(targetPlayer.getUniqueId()); - playerTexture = playerData.getTexture(); + playerData = plugin.getPlayerDataManager().getPlayerData(targetPlayer); + //playerTexture = playerData.getTexture(); islandPlaytime = playerData.getPlaytime(); playTimeDurationTime = NumberUtil.getDuration(islandPlaytime); @@ -571,7 +571,8 @@ public void open(Player player, Members.Type type, Members.Sort sort) { } } } - ItemStack phead = SkullUtils.getSkull(targetPlayer.getUniqueId()); + + ItemStack phead = SkullUtils.getSkull(Bukkit.getPlayerUniqueId(playerName)); nInv.addItem( nInv.createItem(phead, configLoad.getString("Menu.Members.Item.Member.Displayname").replace("%player",