Implemented #42

Players should be already allowed without flairs
This commit is contained in:
Norbi Peti 2016-09-08 16:51:11 +02:00
parent 4031d9df46
commit e83e4724f7
2 changed files with 16 additions and 29 deletions

View file

@ -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);

View file

@ -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;