Open ImUrX opened 2 years ago
I don't understand your issue. Please use images to elaborate further, thx.
Intended Styled Chat behaviour:
Styled Chat behaviour with this mod:
Ok, I will add a exclude list in the next version.
Hello!
Did you add a custom emoji called table
to your Discord server? I'm confused about the :table:
being highlighted in your screenshot.
Also, by "Styled Chat emoji" do you mean the Fabric mod Patbox/StyledChat?
Did you add a custom emoji called table to your Discord server? I'm confused about the :table: being highlighted in your screenshot.
So what happens is that all :text:
is ignored discord emoji or not by StyledChat when this mod is on.
Example, there is a :pos:
emoji which gets replaced by your coordinates (so 100 64 -200
) by StyledChat. But when this mod is on, the message just says :pos:
with white color like it's normal text
Also, by "Styled Chat emoji" do you mean the Fabric mod Patbox/StyledChat? Yes
Yes, I made the issue here because I thought chat text wasn't reaching the StyledChat mod so I deduced the problem was here.
May I take a look at your StyledChat config? I installed StyledChat but it didn't work.
Normally :table:
should not be highlighted by MCDC because it is not an emoji name. So your Discord server has added a custom emote called :table:
?
what happens when you say :table:
Alright, I understand it's because you cancel the function and it never reaches StyledChat's @Redirect
I just used the example config given by the author and it works fine. The situation is the same as your screenshot, except that :table:
is not highlighted.
Alright, I understand it's because you cancel the function and it never reaches StyledChat's @Redirect
In this case, I guess there does not seem to have a solution to this problem?
Yes there is, why cancel it to make mods incompatible where you can conditionally cancel it.
You could also use StyledChat's API
private void handleMessage(TextStream.Message message) {
if (this.player.getClientChatVisibility() == ChatVisibility.HIDDEN) {
this.sendPacket(new GameMessageS2CPacket((new TranslatableText("chat.disabled.options")).formatted(Formatting.RED), MessageType.SYSTEM, Util.NIL_UUID));
} else {
this.player.updateLastActionTime();
String string = message.getRaw();
if (string.startsWith("/")) {
this.executeCommand(string);
} else {
String string2 = message.getFiltered();
Text text = string2.isEmpty() ? null : new TranslatableText("chat.type.text", new Object[]{this.player.getDisplayName(), string2});
Text text2 = new TranslatableText("chat.type.text", new Object[]{this.player.getDisplayName(), string});
this.server.getPlayerManager().broadcast(text2, (player) -> {
return this.player.shouldFilterMessagesSentTo(player) ? text : text2;
}, MessageType.CHAT, this.player.getUuid());
}
this.messageCooldown += 20;
if (this.messageCooldown > 200 && !this.server.getPlayerManager().isOperator(this.player.getGameProfile())) {
this.disconnect(new TranslatableText("disconnect.spam"));
}
}
}
This is the target method void handleMessage(Message message)
of both mods.
this.server.getPlayerManager().broadcast(text2, (player) -> {
return this.player.shouldFilterMessagesSentTo(player) ? text : text2;
}, MessageType.CHAT, this.player.getUuid());
You can see that this method sends a message to all players. Both mods have modified the message, which is why we either redirect or inject and cancel the callback, and both have the same effect that makes the original method not send the original message to all players. If this is not done, the message will be sent twice.
As for the API, I don't think it's taken into consideration as not everyone uses this mod.
If I make a message modification switch, there will be no @ mention and emoji highlighting when it is off. That has to be decided which one to choose I think.
I made a message modification switch in the latest commit. There will be no @mentions and emoji highlighting when it is off, but this gives you the opportunity to keep incompatible mods (like FTB Ranks and StyledChat). You have to decide which one to choose for the time being.
Simplest Environment Tested
Minecraft Version
1.18.2
MCDiscordChat Version
2.0.0-alpha.1
Description
When trying to do a Styled Chat emoji you just get the text you inputted, so if you do
:table:
it just says:table:
instead of(╯°□°)╯︵ ┻━┻
because it tries to check if the emoji exists on Discord. There should be a way to disable thisTo Reproduce
Try using Styled Chat emojis while having this mod on
Log
None
Config
None