From e83e4724f75736099b879ea046fd3869590e1882 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 8 Sep 2016 16:51:11 +0200 Subject: [PATCH] Implemented #42 Players should be already allowed without flairs --- src/buttondevteam/chat/ChatProcessing.java | 43 +++++++------------ .../chat/commands/ucmds/IgnoreCommand.java | 2 +- 2 files changed, 16 insertions(+), 29 deletions(-) diff --git a/src/buttondevteam/chat/ChatProcessing.java b/src/buttondevteam/chat/ChatProcessing.java index 597c672..0ddc3f2 100644 --- a/src/buttondevteam/chat/ChatProcessing.java +++ b/src/buttondevteam/chat/ChatProcessing.java @@ -199,39 +199,26 @@ public class ChatProcessing { .setClickEvent(TellrawEvent.create(TellrawEvent.ClickAC, TellrawEvent.ClickAction.SUGGEST_COMMAND, suggestmsg))); json.addExtra(new TellrawPart(" <")); - json.addExtra( - new TellrawPart( - (player != null ? player.getDisplayName() : sender.getName())) - .setHoverEvent( - TellrawEvent - .create(TellrawEvent.HoverAC, TellrawEvent.HoverAction.SHOW_TEXT, - new TellrawPart("") - .addExtra(new TellrawPart( - String.format("Playername: %s\n", - (player != null ? player.getName() - : sender.getName()))) - .setColor(Color.Aqua)) - .addExtra(new TellrawPart(String.format("World: %s\n", - (player != null ? player.getWorld().getName() - : "-")))) - .addExtra(new TellrawPart(String.format( - "Respect: %s%s%s", - (mp != null ? (mp.FCount / (double) mp.FDeaths) - : "Infinite"), - (mp != null && mp.UserName != null - && !mp.UserName.isEmpty() - ? "\nUserName: " + mp.UserName - : ""), - (mp != null && mp.PlayerName.equals( - "\nAlpha_Bacca44") ? "\nDeaths: " - + PlayerListener.AlphaDeaths - : ""))))))); + json.addExtra(new TellrawPart((player != null ? player.getDisplayName() : sender.getName())).setHoverEvent( + TellrawEvent.create(TellrawEvent.HoverAC, TellrawEvent.HoverAction.SHOW_TEXT, new TellrawPart("") + .addExtra(new TellrawPart(String.format("Flair: %s", mp.GetFormattedFlair()))) + .addExtra(new TellrawPart(String.format("Playername: %s\n", + (player != null ? player.getName() : sender.getName()))).setColor(Color.Aqua)) + .addExtra(new TellrawPart( + String.format("World: %s\n", (player != null ? player.getWorld().getName() : "-")))) + .addExtra(new TellrawPart(String.format("Respect: %s%s%s", + (mp != null ? (mp.FCount / (double) mp.FDeaths) : "Infinite"), + (mp != null && mp.UserName != null && !mp.UserName.isEmpty() + ? "\nUserName: " + mp.UserName : ""), + (mp != null && mp.PlayerName.equals("\nAlpha_Bacca44") + ? "\nDeaths: " + PlayerListener.AlphaDeaths + : ""))))))); json.addExtra(new TellrawPart("> ")); ChatFormatter.Combine(formatters, formattedmessage, json); String jsonstr = new Gson().toJson(json); if (jsonstr.length() >= 32767) { sender.sendMessage( - "§cError: Message too large. Try shortening it, or remove hashtags and other formatting."); + "§cError: Message too long. Try shortening it, or remove hashtags and other formatting."); return true; } DebugCommand.SendDebugMessage(jsonstr); diff --git a/src/buttondevteam/chat/commands/ucmds/IgnoreCommand.java b/src/buttondevteam/chat/commands/ucmds/IgnoreCommand.java index 15bbdeb..66d12c2 100644 --- a/src/buttondevteam/chat/commands/ucmds/IgnoreCommand.java +++ b/src/buttondevteam/chat/commands/ucmds/IgnoreCommand.java @@ -32,7 +32,7 @@ public final class IgnoreCommand extends UCommandBase { p.FlairState = FlairStates.Ignored; p.SetFlair(ChatPlayer.FlairTimeNone); p.UserName = ""; - player.sendMessage("§bYou have ignored the message. You can still use /u accept to get a flair.§r"); + player.sendMessage("§bYou have ignored the message.§r"); } else player.sendMessage("§cYou already ignored the message.§r"); return true;