ServerListPlus icon indicating copy to clipboard operation
ServerListPlus copied to clipboard

Make it simple to center descriptions in the server list

Open stephan-gh opened this issue 9 years ago • 6 comments

Apparently people like doing that, currently you need to add all spaces manually. Need to investigate whether this is easy (enough) to add

stephan-gh avatar May 15 '16 14:05 stephan-gh

So was this ever added? If so is there a guide on how to use it? I am looking for this in this plugin and would really like it for my server and I'm assuming other servers would use it much more! Possibly an alias like \c for center

CosmicPyrex avatar Mar 26 '17 05:03 CosmicPyrex

@CosmicPyrex This is not implemented currently, however you can manually add spaces to center your text.

stephan-gh avatar Mar 26 '17 10:03 stephan-gh

Ok thanks. Are you thinking of adding this in the future do you think?

CosmicPyrex avatar Mar 26 '17 15:03 CosmicPyrex

About this, I'd really love to auto-center the messages in the MOTD. I'm using a self-crafted plugin but now I found SLP I considered trying it, but it doesn't center the MOTD yet. I have a little snippet if you'd like to implement yourself, or if you want, I can open a PR implementing it soon.

Gist

It does work most of the time, but some characters have to be better measured in order to better display them in the MOTD. I didn't make this, I got from a Spigot resource back then. For every character, the measure is listed, the length the character takes in the message. The character i, for example, takes less space than o, etc, as the Minecraft font is not monospaced, not every character takes the same amount of space.

This snippet does account for bold characters taking more space, that's why I find it very useful. I searched a lot to find a good Spigot resource but I don't remember where I got this. Some said you can just count up to 45 because that's the MOTD length, but that doesn't expect you to use only is in your message, that almost doubles the length.

Anyway, hope you implement this soon, I'm desperate to use this plugin and this is the only reason I don't yet.

nirewen avatar Oct 30 '19 22:10 nirewen

Hi @nirewen. Thanks for the suggestion. AFAIK there is no way to implement this reliably (because of different texture packs, ...). This is why I haven't added such a feature yet. Plus, I'm afraid I cannot take the code if you do not know where it is coming from.

However, please don't forget that SLP has an API. You can use it to add custom placeholders in extra plugins. E.g. you could create a plugin that adds something like %CENTER% and would use your code to center all text that is followed by it. This would allow you to use your code together with SLP.

stephan-gh avatar Oct 31 '19 08:10 stephan-gh

The reason of this feature and this issue is automaticaly centering the dynamic line that contain placeholders. Wish its will add in future soon, because the line is jumping out of the server motd, and cant be handle it manualy.

hUwUtao avatar Jun 25 '21 08:06 hUwUtao