Update T2CBtab.java

This commit is contained in:
JaTiTV 2023-06-27 18:01:55 +02:00
parent a3ec7117dd
commit 6f054a8993

View File

@ -10,31 +10,55 @@ import java.util.Iterator;
import java.util.List;
public class T2CBtab {
public static Iterable<String> tab(CommandSender sender, String[] args, String perm,Boolean onlinePlayer){
List<String> matches = new ArrayList<>();
Iterator var6 = ProxyServer.getInstance().getPlayers().iterator();
while (var6.hasNext()) {
ProxiedPlayer player1 = (ProxiedPlayer) var6.next();
if (passend(player1.getName(), args[0]) && hasPermission(sender, perm)){
matches.add(player1.getName());
}
public static void tab(List<String> matches, CommandSender sender, int arg, String[] args, String perm, Boolean onlinePlayer) {
if (args.length != arg + 1) return;
for (ProxiedPlayer player1 : ProxyServer.getInstance().getPlayers()) {
if (passend(player1.getName(), args[arg]) && hasPermission(sender, perm)) {
matches.add(player1.getName());
}
return matches;
}
}
public static Iterable<String> tab(CommandSender sender, String[] args, HashMap<String, String> permMap) {
List<String> matches = new ArrayList<>();
public static void tab(List<String> matches, CommandSender sender, int argEquals, String equalsValue, int arg, String[] args, String perm, Boolean onlinePlayer) {
if (args.length != arg + 1) return;
if (!args[argEquals].toLowerCase().equals(equalsValue)) return;
for (ProxiedPlayer player1 : ProxyServer.getInstance().getPlayers()) {
if (passend(player1.getName(), args[arg]) && hasPermission(sender, perm)) {
matches.add(player1.getName());
}
}
}
public static void tab(List<String> matches, CommandSender sender, int arg, String[] args, HashMap<String, String> permMap, Boolean onlinePlayer, String permForPlayer) {
if (args.length != arg + 1) return;
for (String command : permMap.keySet()) {
if (hasPermission(sender, permMap.get(command)) && passend(command, args[0])) {
if (hasPermission(sender, permMap.get(command)) && passend(command, args[arg])) {
matches.add(command);
} else if (onlinePlayer != null && permForPlayer != null) {
tab(matches, sender, arg, args, permForPlayer, onlinePlayer);
}
}
}
public static void tab(List<String> matches, CommandSender sender, int arg, String[] args, HashMap<String, String> permMap) {
tab(matches, sender, arg, args, permMap, null, null);
}
public static void tab(List<String> matches, CommandSender sender, int argEquals, String equalsValue, int arg, String[] args, HashMap<String, String> permMap) {
if (args.length != arg + 1) return;
if (!args[argEquals].toLowerCase().equals(equalsValue)) return;
for (String command : permMap.keySet()) {
if (hasPermission(sender, permMap.get(command)) && passend(command, args[arg])) {
matches.add(command);
}
}
return matches;
}
public static Iterable<String> tab(CommandSender sender, String[] args, String perm, String command) {
public static List<String> tab(CommandSender sender, int arg, String[] args, String perm, String command) {
List<String> matches = new ArrayList<>();
if (hasPermission(sender, perm) && passend(command, args[0])) {
if (hasPermission(sender, perm) && passend(command, args[arg])) {
matches.add(command);
}
return matches;