Remove Fanciful, fix compilation (part 1/2)

This commit is contained in:
Paul Sauve
2015-05-24 18:05:27 -05:00
parent 535aa5c90e
commit fc1d08e507
11 changed files with 170 additions and 132 deletions

View File

@@ -8,9 +8,11 @@ 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 net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
public class CmdKick extends FCommand {
@@ -34,19 +36,28 @@ public class CmdKick extends FCommand {
public void perform() {
FPlayer toKick = this.argIsSet(0) ? this.argAsBestFPlayerMatch(0) : null;
if (toKick == null) {
FancyMessage msg = new FancyMessage(TL.COMMAND_KICK_CANDIDATES.toString()).color(ChatColor.GOLD);
TextComponent component = new TextComponent(TL.COMMAND_KICK_CANDIDATES.toString());
component.setColor(net.md_5.bungee.api.ChatColor.GOLD);
for (FPlayer player : myFaction.getFPlayersWhereRole(Role.NORMAL)) {
String s = player.getName();
msg.then(s + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_KICK_CLICKTOKICK.toString() + s).command(Conf.baseCommandAliases.get(0) + " kick " + s);
TextComponent then = new TextComponent(s + " ");
then.setColor(net.md_5.bungee.api.ChatColor.WHITE);
then.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new BaseComponent[]{new TextComponent(TL.COMMAND_KICK_CLICKTOKICK.toString() + s)}));
then.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, Conf.baseCommandAliases.get(0) + " kick " + s));
component.addExtra(then);
}
if (fme.getRole() == Role.ADMIN) {
for (FPlayer player : myFaction.getFPlayersWhereRole(Role.MODERATOR)) {
String s = player.getName();
msg.then(s + " ").color(ChatColor.GRAY).tooltip(TL.COMMAND_KICK_CLICKTOKICK.toString() + s).command(Conf.baseCommandAliases.get(0) + " kick " + s);
TextComponent then = new TextComponent(s + " ");
then.setColor(net.md_5.bungee.api.ChatColor.GRAY);
then.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new BaseComponent[]{new TextComponent(TL.COMMAND_KICK_CLICKTOKICK.toString() + s)}));
then.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, Conf.baseCommandAliases.get(0) + " kick " + s));
component.addExtra(then);
}
}
sendFancyMessage(msg);
fme.getPlayer().spigot().sendMessage(component);
return;
}