Fix tab handling and add more commands

This commit is contained in:
Telesphoreo 2022-02-17 20:00:47 -06:00
parent f2db87624f
commit d4578f2255
4 changed files with 4 additions and 4 deletions

View File

@ -308,7 +308,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
PlexPlayer plexPlayer = getPlexPlayer(player); PlexPlayer plexPlayer = getPlexPlayer(player);
if (plugin.getSystem().equalsIgnoreCase("ranks")) if (plugin.getSystem().equalsIgnoreCase("ranks"))
{ {
return rank.isAtLeast(plexPlayer.getRankFromString()); return plexPlayer.getRankFromString().isAtLeast(rank);
} }
else if (plugin.getSystem().equalsIgnoreCase("permissions")) else if (plugin.getSystem().equalsIgnoreCase("permissions"))
{ {

View File

@ -90,6 +90,6 @@ public class BanCMD extends PlexCommand
@Override @Override
public @NotNull List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException public @NotNull List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
{ {
return args.length == 1 && isAdmin(sender) ? PlexUtils.getPlayerNameList() : ImmutableList.of(); return args.length == 1 && checkTab(sender, Rank.ADMIN, "plex.ban") ? PlexUtils.getPlayerNameList() : ImmutableList.of();
} }
} }

View File

@ -48,6 +48,6 @@ public class FreezeCMD extends PlexCommand
@Override @Override
public @NotNull List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException public @NotNull List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
{ {
return args.length == 1 && isAdmin(sender) ? PlexUtils.getPlayerNameList() : ImmutableList.of(); return args.length == 1 && checkTab(sender, Rank.ADMIN, "plex.freeze") ? PlexUtils.getPlayerNameList() : ImmutableList.of();
} }
} }

View File

@ -55,6 +55,6 @@ public class UnbanCMD extends PlexCommand
@Override @Override
public @NotNull List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException public @NotNull List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
{ {
return args.length == 1 && isAdmin(sender) ? PlexUtils.getPlayerNameList() : ImmutableList.of(); return args.length == 1 && checkTab(sender, Rank.ADMIN, "plex.unban") ? PlexUtils.getPlayerNameList() : ImmutableList.of();
} }
} }