Kr1S-D / UltimateAntibotRecoded

Just another antibot plugin =)
34 stars 6 forks source link

Unexpected character in prompt #15

Closed a1375625918 closed 1 year ago

a1375625918 commented 1 year ago

Can these CR characters in boxes at the end of the line be removed?

Untitled

Kr1S-D commented 1 year ago

U need to set the encoding of your java VM to UTF-8

a1375625918 commented 1 year ago

I added -Dfile.encoding=UTF-8 in the command line like this but nothing changed.

java.exe -Dfile.encoding=UTF-8 -jar server.jar

Not sure if I'm doing the right thing.

Kr1S-D commented 1 year ago

use a text editor that supports that encoding like Notepad++ and not the windows editor, and edit it again

a1375625918 commented 1 year ago

messages.yml is the default one and I haven't modified it before.

VSCode said it's already UTF-8 and I tried to switch the default CRLF eol sequence to LF. The result is the same as before.

messages yml - Visual Studio Code 2023_1_23 9_31_34

If I replace YAML list style lines with \n, everything goes as expected.

messages yml - Visual Studio Code 2023_1_23 9_47_23

Minecraft_ 1 19 3 2023_1_23 9_45_46

BTW adding a prefix and suffix section will be easier for operator to manage title and contact information.

prefix:
  - "&fᛃ &4&LU&c&LA&4&LB &fᛃ"
  - ""
suffix:
  - ""
  - "&cDiscord &7» &c&ndiscord.myserver.com"
  - "&c&nmc.yourserver.net"
blacklisted:
  - "&7You have been blacklisted by the &cAntibot System"
  - "&7Contact us on discord providing your &cid&7 to be able to &cplay!"
  - ""
  - "&cReason &7» &c$1"
  - "&cID &7» &c$2"
a1375625918 commented 1 year ago

https://github.com/Kr1S-D/UltimateAntibotRecoded/blob/c8cebbbe5894eab31556a8936aa21b02bdd98297/UltimateAntibot-common/src/main/java/me/kr1s_d/ultimateantibot/common/utils/MessageManager.java#L145

System.lineSeparator() returns "\r\n" on Windows.

Replace it with "\n" may solve my problem, but I don't know if this will cause more problems.

Kr1S-D commented 1 year ago

I will rework the method

Kr1S-D commented 1 year ago

done