TotalFreedomMod/src/main/java/me/totalfreedom/totalfreedommod/commands/Command_findip.java

36 lines
1.0 KiB
Java
Raw Normal View History

package me.totalfreedom.totalfreedommod.commands;
2013-08-12 19:35:59 +00:00
import me.totalfreedom.totalfreedommod.rank.PlayerRank;
import org.apache.commons.lang3.StringUtils;
2013-08-12 19:35:59 +00:00
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = PlayerRank.SUPER_ADMIN, source = SourceType.BOTH)
2013-08-12 19:35:59 +00:00
@CommandParameters(description = "Shows all IPs registered to a player", usage = "/<command> <player>")
public class Command_findip extends FreedomCommand
2013-08-12 19:35:59 +00:00
{
2013-08-12 19:35:59 +00:00
@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
2013-08-12 19:35:59 +00:00
{
if (args.length != 1)
{
return false;
}
2013-08-13 01:33:21 +00:00
final Player player = getPlayer(args[0]);
if (player == null)
2013-08-12 19:35:59 +00:00
{
playerMsg(FreedomCommand.PLAYER_NOT_FOUND);
2013-08-12 19:35:59 +00:00
return true;
}
2013-08-13 01:33:21 +00:00
playerMsg("Player IPs: " + StringUtils.join(plugin.pl.getData(player).getIps(), ", "));
2013-08-12 19:35:59 +00:00
return true;
}
}