Allow getting notes of offline players

This commit is contained in:
Telesphoreo 2022-04-21 21:38:54 -05:00
parent ea834da575
commit 922c3def81

View File

@ -20,8 +20,6 @@ import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.format.NamedTextColor;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -39,12 +37,12 @@ public class NotesCMD extends PlexCommand
return usage(); return usage();
} }
OfflinePlayer player = Bukkit.getPlayer(args[0]); PlexPlayer plexPlayer = DataUtils.getPlayer(args[0]);
if (!player.hasPlayedBefore())
if (plexPlayer == null)
{ {
return messageComponent("playerNotFound"); return messageComponent("playerNotFound");
} }
PlexPlayer plexPlayer = getPlexPlayer(player.getPlayer());
switch (args[1].toLowerCase()) switch (args[1].toLowerCase())
{ {