Improve format handling

This commit is contained in:
Draycia committed 2020-10-11 19:29:18 -07:00
1 parent 16affaaa35
commit 17dae76e13
17 files changed
+37 -78

No files matched your search

@@ -147,11 +147,9 @@ public class CarbonChatChannel implements TextChannel {
final TextColor targetColor = this.channelColor(target);
TextComponent formatComponent = (TextComponent) this.carbonChat.messageProcessor().processMessage(formatEvent.format(),
"br", "\n",
"displayname", displayName,
"color", "<" + targetColor.asHexString() + ">",
"phase", Long.toString(System.currentTimeMillis() % 25),
"server", this.carbonChat.carbonSettings().serverName(),
"message", formatEvent.message());
if (this.isUserSpying(user, target)) {
@@ -177,11 +175,9 @@ public class CarbonChatChannel implements TextChannel {
final TextColor targetColor = this.channelColor(user);
final TextComponent consoleFormat = (TextComponent) this.carbonChat.messageProcessor().processMessage(consoleFormatEvent.format(),
"br", "\n",
"displayname", displayName,
"color", "<" + targetColor.asHexString() + ">",
"phase", Long.toString(System.currentTimeMillis() % 25),
"server", this.carbonChat.carbonSettings().serverName(),
"message", consoleFormatEvent.message());
// TODO: add ConsoleUser to users map
@@ -103,13 +103,11 @@ public class CarbonWhisperChannel implements WhisperChannel {
// Components
final TextComponent senderComponent = (TextComponent) this.carbonChat.messageProcessor().processMessage(
senderFormatEvent.format(),
"br", "\n",
"senderdisplayname", senderName,
"sender", this.sender.name(),
"receiverdisplayname", receiverName,
"receiver", this.audience.name(),
"phase", Long.toString(System.currentTimeMillis() % 25),
"server", this.carbonChat.carbonSettings().serverName(),
"message", senderFormatEvent.message());
final ChatComponentEvent senderComponentEvent = new ChatComponentEvent(this.sender, this.sender, this,
@@ -121,13 +119,11 @@ public class CarbonWhisperChannel implements WhisperChannel {
final TextComponent receiverComponent = (TextComponent) this.carbonChat.messageProcessor().processMessage(
receiverFormatEvent.format(),
"br", "\n",
"senderdisplayname", senderName,
"sender", this.sender.name(),
"receiverdisplayname", receiverName,
"receiver", this.audience.name(),
"phase", Long.toString(System.currentTimeMillis() % 25),
"server", this.carbonChat.carbonSettings().serverName(),
"message", senderFormatEvent.message());
final ChatComponentEvent receiverComponentEvent = new ChatComponentEvent(this.sender, this.audience, this,
@@ -144,13 +140,11 @@ public class CarbonWhisperChannel implements WhisperChannel {
final TextComponent consoleFormat = (TextComponent) this.carbonChat.messageProcessor().processMessage(
consoleFormatEvent.format(),
"br", "\n",
"senderdisplayname", senderName,
"sender", this.sender.name(),
"receiverdisplayname", receiverName,
"receiver", this.audience.name(),
"phase", Long.toString(System.currentTimeMillis() % 25),
"server", this.carbonChat.carbonSettings().serverName(),
"message", senderFormatEvent.message());
// TODO: add ConsoleUser to users map