Add player name auto-completion, Close #105

This commit is contained in:
William committed 2021-11-23 00:26:23 +00:00
1 parent 830a7443b9
commit 8a1cc15d1d
7 files changed
+58 -4

No files matched your search

@@ -2,6 +2,7 @@ package me.william278.huskhomes2.commands;
import me.william278.huskhomes2.MessageManager;
import me.william278.huskhomes2.teleport.TeleportRequestHandler;
import me.william278.huskhomes2.util.NameAutoCompleter;
import org.bukkit.command.Command;
import org.bukkit.entity.Player;
@@ -11,7 +12,7 @@ public class TpaHereCommand extends CommandBase {
protected void onCommand(Player p, Command command, String label, String[] args) {
if (args.length == 1) {
String targetPlayer = args[0];
TeleportRequestHandler.sendTeleportHereRequest(p, targetPlayer);
TeleportRequestHandler.sendTeleportHereRequest(p, NameAutoCompleter.getAutoCompletedName(targetPlayer));
} else {
MessageManager.sendMessage(p, "error_invalid_syntax", command.getUsage());
}