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();
|
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)
|
public boolean isSeniorAdmin(CommandSender sender)
|
||||||
{
|
{
|
||||||
Admin admin = getAdmin(sender);
|
Admin admin = getAdmin(sender);
|
||||||
|
@ -117,16 +117,6 @@ public class Command_mbconfig extends FreedomCommand
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
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)
|
if (args.length == 1)
|
||||||
{
|
{
|
||||||
@ -143,7 +133,6 @@ public class Command_mbconfig extends FreedomCommand
|
|||||||
return plugin.pl.getMasterBuilderNames();
|
return plugin.pl.getMasterBuilderNames();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,8 +298,6 @@ public class Command_saconfig extends FreedomCommand
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||||
{
|
|
||||||
if (sender instanceof Player)
|
|
||||||
{
|
{
|
||||||
if (args.length == 1)
|
if (args.length == 1)
|
||||||
{
|
{
|
||||||
@ -309,31 +307,26 @@ public class Command_saconfig extends FreedomCommand
|
|||||||
{
|
{
|
||||||
arguments.add("info");
|
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;
|
return arguments;
|
||||||
}
|
}
|
||||||
else if (args.length == 2 && args[0].equals("info") && plugin.al.isAdmin(sender))
|
if (args.length == 2 && (args[0].equals("add") || args[0].equals("remove") || args[0].equals("setrank") || args[0].equals("info")))
|
||||||
{
|
|
||||||
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"))
|
|
||||||
{
|
{
|
||||||
return FUtil.getPlayerList();
|
return FUtil.getPlayerList();
|
||||||
}
|
}
|
||||||
}
|
if (args.length == 3 && args[0].equals("setrank"))
|
||||||
else 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();
|
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)
|
protected List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||||
{
|
{
|
||||||
return null;
|
return FUtil.getPlayerList();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isConsole()
|
protected boolean isConsole()
|
||||||
|
Loading…
Reference in New Issue
Block a user