From 03b8f11646ac19c5bf164e63ef4d32133452b6f3 Mon Sep 17 00:00:00 2001 From: drtshock Date: Fri, 14 Nov 2014 09:59:36 -0600 Subject: [PATCH] Add tooltips and click commands to f mod. --- .../java/com/massivecraft/factions/cmd/CmdMod.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdMod.java b/src/main/java/com/massivecraft/factions/cmd/CmdMod.java index 6a3ee862..a0d148f3 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdMod.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdMod.java @@ -4,6 +4,8 @@ import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.Faction; import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Role; +import mkremins.fanciful.FancyMessage; +import org.bukkit.ChatColor; public class CmdMod extends FCommand { @@ -11,7 +13,7 @@ public class CmdMod extends FCommand { super(); this.aliases.add("mod"); - this.requiredArgs.add("player name"); + this.optionalArgs.put("player name", "name"); //this.optionalArgs.put("", ""); this.permission = Permission.MOD.node; @@ -27,7 +29,13 @@ public class CmdMod extends FCommand { public void perform() { FPlayer you = this.argAsBestFPlayerMatch(0); 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);