mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 20:46:41 +00:00
staff -> admins
* rename everything containing staff back to admin (as requested by ryan i've renamed commands like slconfig to saconfig but left "slconfig" as an alias) * format almost every file correctly * a few other improvements
This commit is contained in:
@ -16,7 +16,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
@CommandParameters(description = "Shows (optionally clears) invisible players", usage = "/<command> [clear]")
|
||||
public class Command_invis extends FreedomCommand
|
||||
{
|
||||
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
@ -26,16 +26,20 @@ public class Command_invis extends FreedomCommand
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("clear"))
|
||||
{
|
||||
if(!plugin.sl.isStaff(sender))
|
||||
return noPerms();
|
||||
else
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Clearing all invisibility potion effects from all players", true);
|
||||
return noPerms();
|
||||
}
|
||||
else
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "Clearing all invisibility potion effects from all players", true);
|
||||
clear = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
List<String> players = new ArrayList<String>();
|
||||
@ -43,10 +47,10 @@ public class Command_invis extends FreedomCommand
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (player.hasPotionEffect(PotionEffectType.INVISIBILITY) && !plugin.sl.isVanished(player.getName()))
|
||||
if (player.hasPotionEffect(PotionEffectType.INVISIBILITY) && !plugin.al.isVanished(player.getName()))
|
||||
{
|
||||
players.add(player.getName());
|
||||
if (clear && !plugin.sl.isStaff(player))
|
||||
if (clear && !plugin.al.isAdmin(player))
|
||||
{
|
||||
player.removePotionEffect((PotionEffectType.INVISIBILITY));
|
||||
clears++;
|
||||
@ -59,20 +63,26 @@ public class Command_invis extends FreedomCommand
|
||||
msg("There are no invisible players");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (clear)
|
||||
{
|
||||
msg("Cleared " + clears + " players");
|
||||
}
|
||||
else
|
||||
{
|
||||
msg("Invisible players (" + players.size() + "): " + StringUtils.join(players, ", "));
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (args.length == 1 && plugin.sl.isStaff(sender))
|
||||
if (args.length == 1 && plugin.al.isAdmin(sender))
|
||||
{
|
||||
return Arrays.asList("clear");
|
||||
}
|
||||
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
Reference in New Issue
Block a user