Skip to content

Commit

Permalink
Add - tabComplete in the nopvp command
Browse files Browse the repository at this point in the history
  • Loading branch information
staFF6773 committed Mar 25, 2024
1 parent 2213f23 commit 1d8af45
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class BetterPvPNoPvPCommand extends BaseCommand implements Listener {
Expand All @@ -24,7 +25,7 @@ public class BetterPvPNoPvPCommand extends BaseCommand implements Listener {

public BetterPvPNoPvPCommand(final BetterPvP betterPvP) {
// Establecer el nombre del comando y sus permisos
super("nopvp", new ArrayList<>(), "betterpvp.nopvp", true);
super("nopvp", new ArrayList<>(), "", true);
this.betterPvP = betterPvP;

// Registrar el evento para manejar el daño
Expand Down Expand Up @@ -73,6 +74,15 @@ public void execute(CommandSender sender, String[] args) {
}
}

public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException {
List<String> completions = new ArrayList<>();
if (args.length == 1) {
completions.add("on");
completions.add("off");
}
return completions;
}

/**
* Verifica si el jugador tiene los permisos necesarios.
*
Expand Down

0 comments on commit 1d8af45

Please sign in to comment.