package com.massivecraft.factions.cmd; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.factions.cmd.arg.ARFPlayer; import com.massivecraft.mcore.cmd.req.ReqHasPerm; public class CmdFactionsDeinvite extends FCommand { public CmdFactionsDeinvite() { this.addAliases("deinvite", "deinv"); this.addRequiredArg("player"); this.addRequirements(ReqHasPerm.get(Perm.DEINVITE.node)); // TODO: Base on faction permissions instead? senderMustBeMember = false; senderMustBeOfficer = true; senderMustBeLeader = false; } @Override public void perform() { FPlayer you = this.arg(0, ARFPlayer.getStartAny()); if (you == null) return; if (you.getFaction() == myFaction) { msg("%s is already a member of %s", you.getName(), myFaction.getTag()); msg("You might want to: %s", Factions.get().getOuterCmdFactions().cmdFactionsKick.getUseageTemplate(false)); return; } myFaction.deinvite(you); you.msg("%s revoked your invitation to %s.", fme.describeTo(you), myFaction.describeTo(you)); myFaction.msg("%s revoked %s's invitation.", fme.describeTo(myFaction), you.describeTo(myFaction)); } }