@@ -3,7 +3,10 @@ package com.massivecraft.factions.cmd;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
import mkremins.fanciful.FancyMessage;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
public class CmdDeinvite extends FCommand {
|
||||
@@ -29,27 +32,27 @@ public class CmdDeinvite extends FCommand {
|
||||
public void perform() {
|
||||
FPlayer you = this.argAsBestFPlayerMatch(0);
|
||||
if (you == null) {
|
||||
FancyMessage msg = new FancyMessage("Players you can deinvite: ").color(ChatColor.GOLD);
|
||||
FancyMessage msg = new FancyMessage(TL.COMMAND_DEINVITE_CANDEINVITE.toString()).color(ChatColor.GOLD);
|
||||
for (String id : myFaction.getInvites()) {
|
||||
FPlayer fp = FPlayers.getInstance().getById(id);
|
||||
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.then(name + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_DEINVITE_CLICKTODEINVITE.toString() + name).command("f deinvite " + name);
|
||||
}
|
||||
sendFancyMessage(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
if (you.getFaction() == myFaction) {
|
||||
msg("%s<i> is already a member of %s", you.getName(), myFaction.getTag());
|
||||
msg("<i>You might want to: %s", p.cmdBase.cmdKick.getUseageTemplate(false));
|
||||
msg(TL.COMMAND_DEINVITE_ALREADYMEMBER, you.getName(), myFaction.getTag());
|
||||
msg(TL.COMMAND_DEINVITE_MIGHTWANT, p.cmdBase.cmdKick.getUseageTemplate(false));
|
||||
return;
|
||||
}
|
||||
|
||||
myFaction.deinvite(you);
|
||||
|
||||
you.msg("%s<i> revoked your invitation to <h>%s<i>.", fme.describeTo(you), myFaction.describeTo(you));
|
||||
you.msg(TL.COMMAND_DEINVITE_REVOKED, fme.describeTo(you), myFaction.describeTo(you));
|
||||
|
||||
myFaction.msg("%s<i> revoked %s's<i> invitation.", fme.describeTo(myFaction), you.describeTo(myFaction));
|
||||
myFaction.msg(TL.COMMAND_DEINVITE_REVOKES, fme.describeTo(myFaction), you.describeTo(myFaction));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user