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

@@ -5,8 +5,10 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor;
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;
public class CmdDeinvite extends FCommand {
@@ -31,13 +33,18 @@ public class CmdDeinvite extends FCommand {
public void perform() {
FPlayer you = this.argAsBestFPlayerMatch(0);
if (you == null) {
FancyMessage msg = new FancyMessage(TL.COMMAND_DEINVITE_CANDEINVITE.toString()).color(ChatColor.GOLD);
TextComponent component = new TextComponent(TL.COMMAND_DEINVITE_CANDEINVITE.toString());
component.setColor(net.md_5.bungee.api.ChatColor.GOLD);
for (String id : myFaction.getInvites()) {
FPlayer fp = FPlayers.getInstance().getById(id);
String name = fp != null ? fp.getName() : id;
msg.then(name + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_DEINVITE_CLICKTODEINVITE.format(name)).command(Conf.baseCommandAliases.get(0) + " deinvite " + name);
TextComponent then = new TextComponent(name + " ");
then.setColor(net.md_5.bungee.api.ChatColor.WHITE);
then.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new BaseComponent[]{new TextComponent(TL.COMMAND_DEINVITE_CLICKTODEINVITE.format(name))}));
then.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, Conf.baseCommandAliases.get(0) + " deinvite " + name));
component.addExtra(then);
}
sendFancyMessage(msg);
fme.getPlayer().spigot().sendMessage(component);
return;
}