Add tooltips and click commands to f deinvite.
This commit is contained in:
parent
03b8f11646
commit
2aa7d7f98d
@ -3,6 +3,8 @@ package com.massivecraft.factions.cmd;
|
|||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayers;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
|
import mkremins.fanciful.FancyMessage;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class CmdShowInvites extends FCommand {
|
public class CmdShowInvites extends FCommand {
|
||||||
|
|
||||||
@ -17,11 +19,17 @@ public class CmdShowInvites extends FCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform() {
|
public void perform() {
|
||||||
StringBuilder sb = new StringBuilder();
|
FancyMessage msg = new FancyMessage("Players with pending invites: ").color(ChatColor.GOLD);
|
||||||
for (String id : myFaction.getInvites()) {
|
for (String id : myFaction.getInvites()) {
|
||||||
FPlayer fp = FPlayers.getInstance().getById(id);
|
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);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user