Add tooltips and click commands to f kick.

This commit is contained in:
drtshock 2014-11-14 09:56:13 -06:00
parent 656dc90b33
commit b895fa1e99

View File

@ -8,7 +8,9 @@ import com.massivecraft.factions.event.FPlayerLeaveEvent;
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 com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import mkremins.fanciful.FancyMessage;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
public class CmdKick extends FCommand { public class CmdKick extends FCommand {
@ -16,7 +18,7 @@ public class CmdKick extends FCommand {
super(); super();
this.aliases.add("kick"); this.aliases.add("kick");
this.requiredArgs.add("player name"); this.optionalArgs.put("player name", "player name");
//this.optionalArgs.put("", ""); //this.optionalArgs.put("", "");
this.permission = Permission.KICK.node; this.permission = Permission.KICK.node;
@ -32,7 +34,19 @@ public class CmdKick extends FCommand {
public void perform() { public void perform() {
FPlayer toKick = this.argAsBestFPlayerMatch(0); FPlayer toKick = this.argAsBestFPlayerMatch(0);
if (toKick == null) { 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) { if (fme == toKick) {