2014-10-14 20:30:05 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.FPlayer;
|
|
|
|
import com.massivecraft.factions.FPlayers;
|
|
|
|
import com.massivecraft.factions.struct.Permission;
|
2014-11-14 17:03:57 +01: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() {
|
2014-11-14 17:03:57 +01:00
|
|
|
FancyMessage msg = new FancyMessage("Players with pending invites: ").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;
|
|
|
|
msg.then(name + " ").color(ChatColor.WHITE).tooltip("Click to revoke invite for " + name).command("f deinvite " + name);
|
2014-10-14 20:30:05 +02:00
|
|
|
}
|
2014-11-14 17:03:57 +01:00
|
|
|
|
|
|
|
sendFancyMessage(msg);
|
2014-10-14 20:30:05 +02:00
|
|
|
}
|
2014-11-14 17:03:57 +01:00
|
|
|
|
|
|
|
|
2014-10-14 20:30:05 +02:00
|
|
|
}
|