2014-10-14 20:30:05 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
2014-12-19 13:51:24 +01:00
|
|
|
import com.massivecraft.factions.Conf;
|
2014-10-14 20:30:05 +02:00
|
|
|
import com.massivecraft.factions.FPlayer;
|
|
|
|
import com.massivecraft.factions.FPlayers;
|
|
|
|
import com.massivecraft.factions.struct.Permission;
|
2014-12-08 00:12:52 +01:00
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
2015-05-25 22:46:18 +02:00
|
|
|
import mkremins.fanciful.FancyMessage;
|
|
|
|
import org.bukkit.ChatColor;
|
2014-10-14 20:30:05 +02:00
|
|
|
|
|
|
|
public class CmdShowInvites extends FCommand {
|
|
|
|
|
|
|
|
public CmdShowInvites() {
|
|
|
|
super();
|
|
|
|
aliases.add("showinvites");
|
|
|
|
permission = Permission.SHOW_INVITES.node;
|
|
|
|
|
|
|
|
senderMustBePlayer = true;
|
|
|
|
senderMustBeMember = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform() {
|
2015-05-25 22:46:18 +02:00
|
|
|
FancyMessage msg = new FancyMessage(TL.COMMAND_SHOWINVITES_PENDING.toString()).color(ChatColor.GOLD);
|
2014-10-14 20:30:05 +02:00
|
|
|
for (String id : myFaction.getInvites()) {
|
2014-10-19 07:37:25 +02:00
|
|
|
FPlayer fp = FPlayers.getInstance().getById(id);
|
2014-11-14 17:03:57 +01:00
|
|
|
String name = fp != null ? fp.getName() : id;
|
2015-09-12 06:03:40 +02:00
|
|
|
msg.then(name + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_SHOWINVITES_CLICKTOREVOKE.format(name)).command("/" + Conf.baseCommandAliases.get(0) + " deinvite " + name);
|
2014-10-14 20:30:05 +02:00
|
|
|
}
|
2014-11-14 17:03:57 +01:00
|
|
|
|
2015-05-25 22:46:18 +02:00
|
|
|
sendFancyMessage(msg);
|
2014-10-14 20:30:05 +02:00
|
|
|
}
|
2014-11-14 17:03:57 +01:00
|
|
|
|
2015-01-22 00:58:33 +01:00
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_SHOWINVITES_DESCRIPTION;
|
|
|
|
}
|
|
|
|
|
2014-11-14 17:03:57 +01:00
|
|
|
|
2014-10-14 20:30:05 +02:00
|
|
|
}
|