EssentialsX

EssentialsX

2M Downloads

Paper console colors are broken

HexedHero opened this issue · 17 comments

commented

Type of bug

Compatibility issue, Other unexpected behaviour

/ess dump all output

N/A

Error log (if applicable)

No response

Bug description

Paper changed the logger to not parse color codes and must now use the console command sender for colors in the console.

Steps to reproduce

Do any command that gives feedback messages in the console.

Expected behaviour

Doing /echest without permission for example does
[Essentials] §cHexedHero was denied access to command.
As you can see the console is now a mess with random §'s without any color.

Actual behaviour

It should be
[Essentials] HexedHero was denied access to command.
while being colored red

commented

The Paper pull request, which made this issue is: PaperMC/Paper#7560

commented

Thanks for the report, can verify that this happens. We will probably want to either 1) use the server command sender to send these messages (with prefix prepended) or just strip the color altogether for any logged messages.

commented

Paper-387 (MC: 1.18.2) w/ Essentials 2.19.5-dev+29-09dc49a still has this issue, at least ban messages still isn't formatted and outputs with § instead of any formatting..

commented

Hmm... What version do you using?

I'm using this and it's says that it's latest

This server is running Paper version git-Paper-387 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: df630a2 on ver/1.18.2)
You are running the latest version
commented

This isn't an issue on paper anymore. Use the latest essentials dev build with the latest paper

commented

We (and I think it's not just us) currently can't update to 1.19+ but Essentials declares (full?) support of 1.18.2 in their README. If it works fully and without issues only on latest server version, why are you listing other, older versions?

commented

We (and I think it's not just us) currently can't update to 1.19+ but Essentials declares (full?) support of 1.18.2 in their README. If it works fully and without issues only on latest server version, why are you listing other, older versions?

This is not a bug in the latest 1.18.2 Paper version. I still use 1.18.2 to develop Essentials and this isn't an issue in my console.

commented

bump :/ @JRoy

commented

Hmm... What version do you using?

I'm using this and it's says that it's latest

This server is running Paper version git-Paper-387 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: df630a2 on ver/1.18.2)
You are running the latest version

Don't know what to tell you, works on my end. Either an issue with your terminal setup or some other plugin is messing with your console output but essentials literally doesn't even send section signs to the console anymore

commented

@molor Could you provide a full /ess dump all link so we can investigate potential upstream issues?

commented

Have you at least tried to check the code what might be wrong before telling me that everything "works on your end"...

Okay, let's look at Commandban.java for example. We find a method that takes a string from Essentials translation file:
https://github.com/EssentialsX/Essentials/blob/2.x/Essentials/src/main/java/com/earth2me/essentials/commands/Commandban.java#L63

Related line in my translation file:

playerBanned=§c{1} §fbanned by §c{0}§f. Reason\: §c{2}

#broadcastMessage then splits up this string into lines and just sends it to everyone who have permission:
https://github.com/EssentialsX/Essentials/blob/2.x/Essentials/src/main/java/com/earth2me/essentials/Essentials.java#L1147
Remember that Console also have any permission, so... I'm found the problem instead of you..?
Same issue with kick, togglejail and probably many other commands that uses #broadcastMessage.

Update: Now I'm unsure if #getOnlinePlayers should include server's console or not, but I'm still think that the problem is somewhere here..

commented

(also please don't take my message as disrespect or complaint, I just wanted to help)

commented

Have you at least tried to check the code what might be wrong before telling me that everything "works on your end"...

Okay, let's look at Commandban.java for example. We find a method that takes a string from Essentials translation file:
https://github.com/EssentialsX/Essentials/blob/2.x/Essentials/src/main/java/com/earth2me/essentials/commands/Commandban.java#L63

Related line in my translation file:

playerBanned=§c{1} §fbanned by §c{0}§f. Reason\: §c{2}

#broadcastMessage then splits up this string into lines and just sends it to everyone who have permission:
https://github.com/EssentialsX/Essentials/blob/2.x/Essentials/src/main/java/com/earth2me/essentials/Essentials.java#L1147
Remember that Console also have any permission, so... I'm found the problem instead of you..?

Same issue with kick, togglejail and probably many other commands that uses #broadcastMessage.

Yes I have! I wrote the code in Essentials and on Paper which translates section symbols into actual ANSI colors. Paper converts legacy strings into components which also moves the section signs to actual parsed colors. For section signs sent to the logger, we use Paper's component logger which does the same as above.

The only place section signs still are sent is on Spigot because they broke their console.

commented

Yes let's please be civil here. This specific issue has been closed, but if you have specific reproduction steps and can demonstrate them on a supported server version which can be replicated by the team, please go ahead and open a new issue for this.

As I understand it, this issue was opened for the general problem of console colors not working, which has since been fixed, not more specific bugs related to individual commands/components not functioning as intended.

commented

So it's intended that #broadcastMessage sends section signs to console? It's console's "job" to convert signs into formatting, right?

I'm tried even fresh install of Essentials and Paper 1.18.2 without any log4j changes in Windows 10, but still see section signs in console after kicking/banning someone :(

Update: Oops, don't notice pop4959's message before I'm sent this

commented

@molor We can investigate whether there's a compatibility issue between EssentialsX and particular environments, or whether there might be an issue in Paper. If you could provide an /ess dump all link along with a screenshot of part of the broken log from the same server run, it would help us greatly.

commented

We are unlikely going to be able to look into this immediately so please if you can, include all relevant information in a new issue (including dump, et cetera) and we can evaluate the specific circumstances in which this is not working for you.