Add tooltips and click commands to f mod.

This commit is contained in:
drtshock 2014-11-14 09:59:36 -06:00
parent b895fa1e99
commit 03b8f11646

View File

@ -4,6 +4,8 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction; import com.massivecraft.factions.Faction;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.struct.Role;
import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor;
public class CmdMod extends FCommand { public class CmdMod extends FCommand {
@ -11,7 +13,7 @@ public class CmdMod extends FCommand {
super(); super();
this.aliases.add("mod"); this.aliases.add("mod");
this.requiredArgs.add("player name"); this.optionalArgs.put("player name", "name");
//this.optionalArgs.put("", ""); //this.optionalArgs.put("", "");
this.permission = Permission.MOD.node; this.permission = Permission.MOD.node;
@ -27,7 +29,13 @@ public class CmdMod extends FCommand {
public void perform() { public void perform() {
FPlayer you = this.argAsBestFPlayerMatch(0); FPlayer you = this.argAsBestFPlayerMatch(0);
if (you == null) { if (you == null) {
return; FancyMessage msg = new FancyMessage("Players you can promote: ").color(ChatColor.GOLD);
for (FPlayer player : myFaction.getFPlayersWhereRole(Role.NORMAL)) {
String s = player.getName();
msg.then(s + " ").color(ChatColor.WHITE).tooltip("Click to promote " + s).command("f mod " + s);
}
sendFancyMessage(msg);
} }
boolean permAny = Permission.MOD_ANY.has(sender, false); boolean permAny = Permission.MOD_ANY.has(sender, false);