/f showinvites for ability to see pending invites for current faction. Adds feature in ticket #76
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
|
||||
public class CmdShowInvites extends FCommand {
|
||||
|
||||
public CmdShowInvites() {
|
||||
super();
|
||||
aliases.add("showinvites");
|
||||
permission = Permission.SHOW_INVITES.node;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String id : myFaction.getInvites()) {
|
||||
FPlayer fp = FPlayers.i.get(id);
|
||||
sb.append(fp != null ? fp.getName() : id).append(" ");
|
||||
}
|
||||
msg("<a>Players with pending invites: <i> %s", sb.toString().trim());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user