Chat Heads

Chat Heads

35M Downloads

[Enhancement] support for Styled Nicknames

Fauli1221 opened this issue · 8 comments

commented

support for mods like HD Skins

right now if you have a skin with that mod the Icon is blank (not tested if it works with a non hd skin)
grafik

commented

Okay I use a few other mods here is my mod list
https://github.com/Fauli1221/skycraft1/tree/main/main/mods

If it's not an issue with HDSkins it's a probably https://modrinth.com/mod/styled-nicknames

Sorry for not properly testing it

commented

I was able to confirm that it happens when someone is Nicked with Styled Nicknames I'm sorry for the initial misslead on my side I should have tested that

commented

Haven't tested this but the issue should be that the messages have no sender UUIDs and the sender names (nicknames) don't match the actual player names (profile names or names in the tab display list).
If that's the case, there's no way to automatically find the message's owner but you can manually add a name alias in Chat Heads' config, e.g.
Sky Splash -> <exact name in the tab player list>
Oh right, spaces in the name on the left wouldn't work, as it'd interpret that as 2 names Sky and Splash.
I assume the name is actually Sky_Splash, else putting SkySplash should do the trick.
(Chat Heads removes spaces and any invalid character (§.)|[^\w] before comparing names.)

https://github.com/Patbox/StyledNicknames/blob/9536456edf54c61bffbe18e3e8f7c18e462b9b64/src/main/java/eu/pb4/stylednicknames/mixin/ServerPlayerEntityMixin.java#L33
From quickly glancing at the code it looks like Styled Nicknames adds a team name prefix to the tab player list, so maybe that's the issue?
Does it look like [Team] Sky_Splash in the player list? If so, I can try to stripping out [prefix] before comparing names.

commented

I just noticed there was an issue with StyledNicknames before and I changed it to use the name of the click /tell command, see #72.
Does clicking the sender name give the correct /tell command? If not, this looks like an issue of StylesNicknames.

Edit:
I can replicate the issue! Time to get debugging.

commented

Does clicking the sender name give the correct /tell command?

yes
grafik

commented

Ah, the issue isn't with StyledNicknames directly, it's with the fact the messages are system messages.
(Could only reproduce with NoChatReports on the server, which turns everything into system messages.)
System messages do not have a sender decoration, which is where Chat Heads is primarily looking for the sender name, including names from the click /tell command.
If there's no sender decoration, it uses a "heuristic" aka it stupidly checks every word against all player names.
With the default StyledNicknames settings, message names are changed, but neither the tab display names nor profile names change, thus it will fail to find a match.
(In your case this is even worse since Arcane Spark are two words, so it'd check for players Arcane and Spark.)

To fix this I think Chat Heads needs to check /tell commands in undecorated messages as well - and hope that this doesn't break anything (I might add a few sanity checks).

commented

test
Works for me.

What Minecraft version are you on? What mod versions are you using? Other mods?

commented

Alright, should be fixed, new versions are up!