mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
bug fixing
This commit is contained in:
parent
baf5fd42f6
commit
357eddf51a
@ -106,6 +106,17 @@ public class AdminList extends FreedomService
|
||||
return admin != null && admin.isActive();
|
||||
}
|
||||
|
||||
public boolean isTelnetAdmin(CommandSender sender)
|
||||
{
|
||||
Admin admin = getAdmin(sender);
|
||||
if (admin == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return admin.getRank().ordinal() >= Rank.TELNET_ADMIN.ordinal();
|
||||
}
|
||||
|
||||
public boolean isSeniorAdmin(CommandSender sender)
|
||||
{
|
||||
Admin admin = getAdmin(sender);
|
||||
|
@ -117,16 +117,6 @@ public class Command_mbconfig extends FreedomCommand
|
||||
}
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (sender instanceof Player)
|
||||
{
|
||||
if (args.length == 1)
|
||||
{
|
||||
return Arrays.asList("list");
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (args.length == 1)
|
||||
{
|
||||
@ -143,7 +133,6 @@ public class Command_mbconfig extends FreedomCommand
|
||||
return plugin.pl.getMasterBuilderNames();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
@ -298,8 +298,6 @@ public class Command_saconfig extends FreedomCommand
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (sender instanceof Player)
|
||||
{
|
||||
if (args.length == 1)
|
||||
{
|
||||
@ -309,31 +307,26 @@ public class Command_saconfig extends FreedomCommand
|
||||
{
|
||||
arguments.add("info");
|
||||
}
|
||||
if (plugin.al.isTelnetAdmin(sender))
|
||||
{
|
||||
arguments.add("add");
|
||||
arguments.add("remove");
|
||||
}
|
||||
if (plugin.al.isSeniorAdmin(sender))
|
||||
{
|
||||
arguments.add("reload");
|
||||
arguments.add("clean");
|
||||
arguments.add("setrank");
|
||||
}
|
||||
return arguments;
|
||||
}
|
||||
else if (args.length == 2 && args[0].equals("info") && plugin.al.isAdmin(sender))
|
||||
{
|
||||
return plugin.al.getActiveAdminNames();
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (args.length == 1)
|
||||
{
|
||||
return Arrays.asList("add", "remove", "clean", "reload", "setrank", "info", "list");
|
||||
}
|
||||
else if (args.length == 2)
|
||||
{
|
||||
if (args[0].equals("add") || args[0].equals("remove") || args[0].equals("setrank") || args[0].equals("info"))
|
||||
if (args.length == 2 && (args[0].equals("add") || args[0].equals("remove") || args[0].equals("setrank") || args[0].equals("info")))
|
||||
{
|
||||
return FUtil.getPlayerList();
|
||||
}
|
||||
}
|
||||
else if (args.length == 3 && args[0].equals("setrank"))
|
||||
if (args.length == 3 && args[0].equals("setrank"))
|
||||
{
|
||||
return Arrays.asList("super_admin", "telnet_admin", "senior_admin");
|
||||
}
|
||||
return Arrays.asList("SUPER_ADMIN", "TELNET_ADMIN", "SENIOR_ADMIN");
|
||||
}
|
||||
|
||||
return Collections.emptyList();
|
||||
|
@ -293,7 +293,7 @@ public abstract class FreedomCommand implements CommandExecutor, TabCompleter
|
||||
|
||||
protected List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
return null;
|
||||
return FUtil.getPlayerList();
|
||||
}
|
||||
|
||||
protected boolean isConsole()
|
||||
|
Loading…
Reference in New Issue
Block a user