mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-12-17 22:27:57 +01:00
/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 CmdVersion cmdVersion = new CmdVersion();
|
||||||
public CmdWarunclaimall cmdWarunclaimall = new CmdWarunclaimall();
|
public CmdWarunclaimall cmdWarunclaimall = new CmdWarunclaimall();
|
||||||
public CmdSB cmdSB = new CmdSB();
|
public CmdSB cmdSB = new CmdSB();
|
||||||
|
public CmdShowInvites cmdShowInvites = new CmdShowInvites();
|
||||||
|
|
||||||
public FCmdRoot() {
|
public FCmdRoot() {
|
||||||
super();
|
super();
|
||||||
@ -120,6 +121,7 @@ public class FCmdRoot extends FCommand {
|
|||||||
this.addSubCommand(this.cmdVersion);
|
this.addSubCommand(this.cmdVersion);
|
||||||
this.addSubCommand(this.cmdWarunclaimall);
|
this.addSubCommand(this.cmdWarunclaimall);
|
||||||
this.addSubCommand(this.cmdSB);
|
this.addSubCommand(this.cmdSB);
|
||||||
|
this.addSubCommand(this.cmdShowInvites);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -50,6 +50,7 @@ public enum Permission {
|
|||||||
SET_PEACEFUL("setpeaceful"),
|
SET_PEACEFUL("setpeaceful"),
|
||||||
SET_PERMANENT("setpermanent"),
|
SET_PERMANENT("setpermanent"),
|
||||||
SET_PERMANENTPOWER("setpermanentpower"),
|
SET_PERMANENTPOWER("setpermanentpower"),
|
||||||
|
SHOW_INVITES("showinvites"),
|
||||||
POWERBOOST("powerboost"),
|
POWERBOOST("powerboost"),
|
||||||
POWER("power"),
|
POWER("power"),
|
||||||
POWER_ANY("power.any"),
|
POWER_ANY("power.any"),
|
||||||
|
Loading…
Reference in New Issue
Block a user