Minecrell / ServerListPlus

A flexible Minecraft plugin to customize the appearance of your server in the server list
https://git.io/slp
GNU General Public License v3.0
240 stars 58 forks source link

[1.16.1] Online counter hover shows as a single line. #296

Closed mrfloris closed 3 years ago

mrfloris commented 4 years ago

ServerListPlus.yml.zip Spigot 1.16.1 ProtocolLib ServerListPlus.mp4.zip

>ver
[05:08:02] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-ad703da-e2403a3 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT)
[05:08:02] [Server thread/INFO]: Checking version, please wait...
[05:08:03] [Thread-12/INFO]: You are running the latest version
>ver ProtocolLib
[05:08:05] [Server thread/INFO]: ProtocolLib version 4.6.0-SNAPSHOT-b466
[05:08:05] [Server thread/INFO]: Provides read/write access to the Minecraft protocol.
[05:08:05] [Server thread/INFO]: Authors: dmulloy2 and comphenix
>ver ServerListPlus
[05:08:07] [Server thread/INFO]: ServerListPlus version 3.5.0-SNAPSHOT
[05:08:07] [Server thread/INFO]: A flexible Minecraft plugin to customize the appearance of your server in the server list
[05:08:07] [Server thread/INFO]: Website: https://git.io/slp
[05:08:07] [Server thread/INFO]: Author: Minecrell (https://github.com/Minecrell)
>

Using the 1.16.1 build of protocollib, and latest jenkins of serverlistplus as well. The hoverover shows strange, all on one line.

stephan-gh commented 4 years ago

Looks like they broke parsing of \n (new lines) inside the player hover message :(

Try setting

Samples:
  Multiple: false

to true, that might help.

mrfloris commented 4 years ago

Eeeeyh that fixed it it's false on 1.15.2 and works there, interesting! glad this resolved it. Another plugin running on 1.16.1 ;)

Screenshot 2020-06-29 at 10 54 41
stephan-gh commented 4 years ago

Should probably change the default at some point, since this affects everyone on 1.16. PRs welcome.

Andre601 commented 4 years ago

I would like to know what would be the solution to fixing this in your own plugin, as I face this issue in my BungeeCord plugin and can't really figure out how to fix this.

Edit: Found the solution.

For anyone that is curious, this may fix your issue (BungeeCord):

List<String> list = // Get the lines
ServerPing.PlayerInfo[] sample = new ServerPing.PlayerInfo[list.size()];
for(int i = 0; i < sample.length(); i++)
    sample[i] = new ServerInfo.PlayerInfo(list.get(i), "0-0-0-0-0");

// assume event is an instance of the ProxyPingEvent
event.getPlayers().setSample(sample);
lilmayu commented 4 years ago

Well.. on plugin version 3.4.8 (and even on 3.5.0) it is like this https://imgur.com/a/hbJ8753 Config: https://imgur.com/a/TDTk6fH

EDIT: Alright. This helped.

Looks like they broke parsing of \n (new lines) inside the player hover message :(

Try setting

Samples:
  Multiple: false

to true, that might help.