Actually add Player as a field to the commands

This commit is contained in:
2022-02-03 22:01:30 -06:00
parent fe53f5c49f
commit 081a702c70
25 changed files with 81 additions and 50 deletions

View File

@ -21,6 +21,7 @@ import net.kyori.adventure.text.format.TextDecoration;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
@CommandParameters(name = "namehistory", description = "Get the name history of a player", usage = "/<command> <player>", aliases = "nh")
@ -30,7 +31,7 @@ public class NameHistoryCMD extends PlexCommand
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("MM/dd/yyyy 'at' HH:mm:ss");
@Override
public Component execute(CommandSender sender, String[] args)
public Component execute(CommandSender sender, Player playerSender, String[] args)
{
if (args.length != 1)
{
@ -38,7 +39,6 @@ public class NameHistoryCMD extends PlexCommand
}
String username = args[0];
UUID uuid;
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayerIfCached(username);
if (offlinePlayer != null)