PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
9.86k stars 2.28k forks source link

console hex support giving me weird behavior #5248

Closed mrfloris closed 3 years ago

mrfloris commented 3 years ago
Bukkit.getConsoleSender().sendMessage("§x§a§a§a§a§0§0Test"); # Works
Bukkit.getConsoleSender().sendMessage("§x§a§a§a§a§0§0§eTest"); # Breaks apart because of extra §e color code
Screenshot 2021-02-25 at 15 04 14

What behaviour is expected:

Screenshot 2021-02-25 at 14 55 29 Screenshot 2021-02-25 at 14 56 20 Screenshot 2021-02-25 at 14 56 26

What behaviour is observed:

Screenshot 2021-02-25 at 14 56 59 Screenshot 2021-02-25 at 14 57 07 Screenshot 2021-02-25 at 14 57 18 Screenshot 2021-02-25 at 14 57 21

Steps/models to reproduce:

For example, in CMI using CMI as chat manager, I can enable custom join/leave msgs, and use hex colors. Mine for example look like these:

  FirstJoin: '{#Cerulean>} 1MB Server »{#Lochmara<}{#Feijoa} Welcome new player &6[playerDisplayName]{#Feijoa}
    to 1MoreBlock.com!'
  LogoutCustom: '{#Cerulean} - {#Feijoa}Player &l[playerDisplayName]&r {#Feijoa}left.'
  LoginCustom: '{#Cerulean>} 1MB Server »{#Lochmara<}{#Feijoa} Welcome back &6[playerDisplayName]
    {#Feijoa}❤'
  deathlocation: '{#Cerulean>} 1MB Server »{#Lochmara<}{#Feijoa} You died at x:&6[x]{#Feijoa},
    y:&6[y]{#Feijoa}, z:&6[z]{#Feijoa} in &6[world]'

Note: the > < within the hex color codes make it a gradient as seen in the first screenshot.

Plugin list:

CMI

Paper version:

> version
[14:59:24 INFO]: --------------------------------------------------
[14:59:24 INFO]: CMI plugin version: 8.8.1.5 SqLite
[14:59:24 INFO]: CMILib: 1.0.0.2
[14:59:24 INFO]: Server: Paper(497) 1.16.5-R0.1-SNAPSHOT
[14:59:24 INFO]: CMI economy: True Vault: 1.7.3-b CMI Chat: True
[14:59:24 INFO]: Modules -> 53 enabled 1 disabled: flightCharge
[14:59:24 INFO]: --------------------------------------------------
> ver
[14:59:26 INFO]: This server is running Paper version git-Paper-497 (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)
[14:59:26 INFO]: Checking version, please wait...
[14:59:27 INFO]: Previous version: git-Paper-496 (MC: 1.16.5)
[14:59:27 INFO]: You are running the latest version
>

Anything else:

Martin mentioned on Discord they wanted a bug report, because it shouldn't be the plugin's that need to get fixed, and it's likely a bug in paper's log event pattern converter. I hope this information for this one particular plugin helps. It's the easiest one for me reproduce at the moment.

JRoy commented 3 years ago

working on this

mrfloris commented 3 years ago
Screenshot 2021-02-25 at 19 46 05 Screenshot 2021-02-25 at 19 46 00

This seems to be a good step forward, easier to read.

Not sure where the underlines come from ~ why it's a bit bold in the beginning and stops halfway through, but .. this is already a lot easier to work with at least.

Thank you.

Proximyst commented 3 years ago

@JRoy Willing to handle this too?

JRoy commented 3 years ago

I'm going to need the raw legacy text which inflicted that result

mrfloris commented 3 years ago

I'm going to need the raw legacy text which inflicted that result

I do not know what that means, besides the stuff I've shared in the first post.

JRoy commented 3 years ago

I need to the pre-formatted string that looks like this: image

mrfloris commented 3 years ago

I need to the pre-formatted string that looks like this: image

Okay, I will poke @zrips who can perhaps provide that.

Also, I noticed background highlighting happening for a /msg to player, when i use the hex {#orange}

Screenshot 2021-02-25 at 19 59 12 Screenshot 2021-02-25 at 19 58 58

customalias.yml for /celebration command using hex colors

  celebration:
    Cmds:
    - asPlayer! warp celebration
    - asConsole! cmi msg [playerName] !{#Cerulean} •&l&m                                                &r{#Cerulean}•
    - asConsole! cmi msg [playerName] !{#magenta} The {#yellow}1MoreBlock.com Community{#magenta}
      is now TEN years old! We are celebrating our anniversary throughout the year.
      Check the {#orange}/forums{#magenta} for detailed information.
    - asConsole! cmi msg [playerName] !{#yellow} https://omgboards.com/threads/263614/
    - asConsole! cmi msg [playerName] !{#Cerulean} •&l&m                                                &r{#Cerulean}•
    - 'asConsole! cmi msg [playerName] !{#orange} Available commands:'
    - asConsole! cmi msg [playerName] !{#green} - /celebration
    - asConsole! cmi msg [playerName] !{#green} - /celebration lootbox
    - asConsole! cmi msg [playerName] !{#green} - /celebration mikey
    - asConsole! cmi msg [playerName] !{#green} - /celebration stick
    - asConsole! cmi msg [playerName] !{#green} - /celebration giveaway
    - asConsole! cmi msg [playerName] !{#green} - /celebration soulbind
    - asConsole! cmi msg [playerName] !{#green} - /celebration dropparty
    - asConsole! cmi msg [playerName] !{#green} - /celebration bedrocker
    - asConsole! cmi msg [playerName] !{#Cerulean} •&l&m                                                &r{#Cerulean}•
JRoy commented 3 years ago

In the meantime, what console are you using?

mrfloris commented 3 years ago

In the meantime, what console are you using?

I honestly can't find evidence that it matters, it's the same on ubuntu, freebsd, macos. The info provided in this ticket looks the same for Terminal.app and iTerm.app with xterm-256colors on macOS Catalina for both local server on same machine and remote servers.

JRoy commented 3 years ago

@Proximyst and I have tested against again a bunch of color codes and tried to mimic the color codes you used with the config from CMI you provided and still cannot reproduce this bug. This is most definitely a terminal issue or CMI doing some crazy dumb shit with color codes which wouldn't shock me.

Proximyst commented 3 years ago

Issue is caused by GNU/screen. Broken with screen & screen -U; works fine with tmux & no terminal multiplexer with alacritty terminal emulator and alacritty terminfo (gzip -9cf | base64):

H4sIAAAAAAACA61Xa2xcRxU+szNOcJUopbSlcEVJgBtK1NR379yZu5vb5mE7wXb92NohmGyN7NpO
1smuY683iVM/kh+QovAqqJVoVUSrVrwFRVCBIKg8ChWPIqEi8RASIEElXkJFBX4UMOfMmd004IIQ
XGe+78w5M9/Mzsyde/JKsR22wxb4oNiyYaI6MVmfaTTOLLesrY3pem1mdqK6dbp2sjrROFEHEO4f
iBbQ45ytGogSvASug7V1HhBrZwEUbMAWr4DrcfQdcBO2LEIf9EMJ3oz2W+AI4jGYhUVYhnNon4cL
8F64B60PwyfgUeTH4IvwODwBT8H34UdY/w38Af4Ez6O1WaytbRE82jbk0NuvR75RNOcRiUTsErtF
pzgg+sWwGBVvFVOigvEalnlxSi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p+tX27LGHthLUTp30rH0y8qaaobmdpr8NyFuVjnRib
Fopjk+iiootZUsSD5Q/5WJLxHVc/escu9yLExqyEO/CFiKJoJewI45vi0Q46qi8WSdaPBLfTaO4q
cuheYnfslwor4c1hQ7uBw2nnylvnKzbjOymicVN5eu5duLx7sk73fHRZ/+Ty/nj2awA5TLZuwRxJ
SUq+NsLLMOvaARFksB+zqRE4DBNQgRNwClbgbfBOeD/cBw/CR+BT8BhchK/Dt1329DN4Bn4Pz2H2
lBPt4krxcnG9CMWNQmOGtE/0iCFxSIxhdnRc1MUZcU7cJd4j7hUPiIcx+/mM+DyOLDGfa4dNmEle
BddAgHnda+EG2AkxpDiXvTibPhiCgzifccztqlDHzG4VZ3QB7oZ74X74EDwCH4NP46y+BF+FJzGr
exp+jPP6FfwWnoW/wN9A4sy2iGtEILbh3HaIDszfipi/dQnc/XxMu4/fKlqfBbruNH79xox3uG+e
c0db5+nK3OXWsfUpck5/NvGKZDJMlildfeHlr5kSJsNkmVLfhK+hhMkwWaaUSfdwEybDZJlSvr74
deEpxf6l9+9nc0q6m1WYDJNlSvnacyqWVSyrWFaxrOLfY8NN/G3kLw7TGoi/fwmTYbJMaVfro0gt
mRImw2SZUqKYXtoywr5RGD0IXXXoWoD9GgYWYGQaRvD/GoswsgDHu7s0QUJgCCxBijBIhYKDFByk
4CAFBzG4f7BbO0wcGofWIUZ7hga0w8ShcWgdYrSXRuylEXtpxF4asZdG7D9wUDtMHBqH1iFGB0cp
ipg4NA6tQ4yWhg9ph4lD49A6xOhwL/VFTBwah9YhRt9UoqIJEgJDYAlSqNcWF2GB4B/KX9f1yA0A
AA==
mrfloris commented 3 years ago

Thank you all for looking into it. I am already glad the §x stuff is all gone and I can read the console again. That the underline or random bold stuff is left due to screen, so be it. At least we narrowed that down.