From 6f42f028fc63c89875c2a33b541a3a6e446675f1 Mon Sep 17 00:00:00 2001 From: Husky <39809509+Huskydog9988@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:52:08 -0400 Subject: [PATCH] add player suggestion for nlcpn --- .../civproxy/renamer/ChangePlayerNameCommand.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/civproxy-velocity/src/main/java/net/civmc/civproxy/renamer/ChangePlayerNameCommand.java b/plugins/civproxy-velocity/src/main/java/net/civmc/civproxy/renamer/ChangePlayerNameCommand.java index 828e4a715..2b1bbfd3c 100644 --- a/plugins/civproxy-velocity/src/main/java/net/civmc/civproxy/renamer/ChangePlayerNameCommand.java +++ b/plugins/civproxy-velocity/src/main/java/net/civmc/civproxy/renamer/ChangePlayerNameCommand.java @@ -5,6 +5,7 @@ import com.velocitypowered.api.command.SimpleCommand; import com.velocitypowered.api.proxy.ProxyServer; import net.civmc.nameApi.NameAPI; import net.kyori.adventure.text.Component; +import java.util.List; import java.util.UUID; public class ChangePlayerNameCommand implements SimpleCommand { @@ -43,4 +44,16 @@ public class ChangePlayerNameCommand implements SimpleCommand { public boolean hasPermission(Invocation invocation) { return invocation.source().hasPermission("civproxy.changeplayername"); } + + @Override + public List suggest(final Invocation invocation) { + List suggestions = new java.util.ArrayList<>(); + if (invocation.arguments().length > 1) { + return suggestions; // No suggestions for the second argument + } + + // Suggest online player names for the first argument + server.getAllPlayers().forEach(player -> suggestions.add(player.getUsername())); + return suggestions; + } }