From b895fa1e99b6880fc5b7843ca66930a044529731 Mon Sep 17 00:00:00 2001 From: drtshock Date: Fri, 14 Nov 2014 09:56:13 -0600 Subject: [PATCH] Add tooltips and click commands to f kick. --- .../com/massivecraft/factions/cmd/CmdKick.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdKick.java b/src/main/java/com/massivecraft/factions/cmd/CmdKick.java index 590cea46..3aa2c26e 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdKick.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdKick.java @@ -8,7 +8,9 @@ import com.massivecraft.factions.event.FPlayerLeaveEvent; import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.zcore.util.TL; +import mkremins.fanciful.FancyMessage; import org.bukkit.Bukkit; +import org.bukkit.ChatColor; public class CmdKick extends FCommand { @@ -16,7 +18,7 @@ public class CmdKick extends FCommand { super(); this.aliases.add("kick"); - this.requiredArgs.add("player name"); + this.optionalArgs.put("player name", "player name"); //this.optionalArgs.put("", ""); this.permission = Permission.KICK.node; @@ -32,7 +34,19 @@ public class CmdKick extends FCommand { public void perform() { FPlayer toKick = this.argAsBestFPlayerMatch(0); if (toKick == null) { - return; + FancyMessage msg = new FancyMessage("Players you can kick: ").color(ChatColor.GOLD); + for (FPlayer player : myFaction.getFPlayersWhereRole(Role.NORMAL)) { + String s = player.getName(); + msg.then(s + " ").color(ChatColor.WHITE).tooltip("Click to kick " + s).command("f kick " + s); + } + if (fme.getRole() == Role.ADMIN) { + for (FPlayer player : myFaction.getFPlayersWhereRole(Role.MODERATOR)) { + String s = player.getName(); + msg.then(s + " ").color(ChatColor.GRAY).tooltip("Click to kick " + s).command("f kick " + s); + } + } + + sendFancyMessage(msg); } if (fme == toKick) {