Add tooltips and click commands to f deinvite.

This commit is contained in:
drtshock 2014-11-14 10:03:57 -06:00
parent 03b8f11646
commit 2aa7d7f98d
2 changed files with 12 additions and 4 deletions

View File

@ -3,6 +3,8 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.struct.Permission;
import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor;
public class CmdShowInvites extends FCommand {
@ -17,11 +19,17 @@ public class CmdShowInvites extends FCommand {
@Override
public void perform() {
StringBuilder sb = new StringBuilder();
FancyMessage msg = new FancyMessage("Players with pending invites: ").color(ChatColor.GOLD);
for (String id : myFaction.getInvites()) {
FPlayer fp = FPlayers.getInstance().getById(id);
sb.append(fp != null ? fp.getName() : id).append(" ");
String name = fp != null ? fp.getName() : id;
msg.then(name + " ").color(ChatColor.WHITE).tooltip("Click to revoke invite for " + name).command("f deinvite " + name);
}
msg("<a>Players with pending invites: <i> %s", sb.toString().trim());
sendFancyMessage(msg);
}
}