Skip to content

Commit

Permalink
[Fixed] /is members Was throwing NPE for Players
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamHRLive committed Mar 25, 2024
1 parent ac3be7a commit abfa779
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/com/craftaro/skyblock/menus/Members.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand All @@ -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);

Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit abfa779

Please sign in to comment.