/f showinvites for ability to see pending invites for current faction. Adds feature in ticket #76
This commit is contained in:
parent
bfc904332a
commit
a170a0f4ad
@ -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());
|
||||
}
|
||||
}
|
@ -52,6 +52,7 @@ public class FCmdRoot extends FCommand {
|
||||
public CmdVersion cmdVersion = new CmdVersion();
|
||||
public CmdWarunclaimall cmdWarunclaimall = new CmdWarunclaimall();
|
||||
public CmdSB cmdSB = new CmdSB();
|
||||
public CmdShowInvites cmdShowInvites = new CmdShowInvites();
|
||||
|
||||
public FCmdRoot() {
|
||||
super();
|
||||
@ -120,6 +121,7 @@ public class FCmdRoot extends FCommand {
|
||||
this.addSubCommand(this.cmdVersion);
|
||||
this.addSubCommand(this.cmdWarunclaimall);
|
||||
this.addSubCommand(this.cmdSB);
|
||||
this.addSubCommand(this.cmdShowInvites);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -50,6 +50,7 @@ public enum Permission {
|
||||
SET_PEACEFUL("setpeaceful"),
|
||||
SET_PERMANENT("setpermanent"),
|
||||
SET_PERMANENTPOWER("setpermanentpower"),
|
||||
SHOW_INVITES("showinvites"),
|
||||
POWERBOOST("powerboost"),
|
||||
POWER("power"),
|
||||
POWER_ANY("power.any"),
|
||||
|
Loading…
Reference in New Issue
Block a user