Skip to content

Python: Use a higher protocol number to get the gradient motd. #256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

molanp
Copy link

@molanp molanp commented Mar 23, 2025

Proposed Changes

  • Python: When performing a json query, send a higher protocol number to get the motd data (e.g. MiniMotd) that contains the correct gradient.

@AppVeyorBot
Copy link

Build minestat 1.0.0.505 completed (commit 3dea70f941 by @)

@mindsolve
Copy link
Collaborator

Sounds initally like a good idea, if older servers behave correctly with protocol versions above their own. This would need to be tested (and also how the other MC server implementations handle this, like Sponge, Bukkit/Spigot/PaperMC) and esp. servers with ViaVersion.

@molanp
Copy link
Author

molanp commented Mar 26, 2025

This modification only affects Java servers. From the documentation, the change in this protocol number does not affect the integrity of the query results.

@mindsolve
Copy link
Collaborator

From the documentation, the change in this protocol number does not affect the integrity of the query results

That might be correct, but better check to make sure. Especially with so many server implementations, mods and vendors 😉

So I've tested the change with the following servers:

  • Vanilla 1.8.9
  • Vanilla 1.9
  • Vanilla 1.19.3
  • Forge 1.19.2
  • SpongeVanilla 1.19.3 (API10)
  • Velocity 3.1.2
  • Two servers with ViaVersion installed
  • flying squid (PrismarineJS) 1.11.0 (MC 1.8-1.21)

And everything looks good :)
But I was unable to see the problem you mentioned - something about gradients in the MOTD? Could you - just for quickly cross-checking - provide a example for this.

Thanks & BR

@molanp
Copy link
Author

molanp commented Apr 22, 2025

For example, on a java server with MiniMOTD installed, if a gradient color is used, MiniMOTD will return a MOTD message that does not contain a gradient to clients with a lower version than the current server.

References from:
https://www.spigotmc.org/resources/minimotd-server-list-motd-plugin-with-rgb-gradients.81254/

  • Downsample RGB Colors for outdated client.

This means:
For clients prior to version 1.16, the RGB color is automatically replaced with the closest color to the original color.

This is because versions of Minecraft below 1.16 do not support RGB colors.

MiniMOTD identifies the client version by the protocol number sent by the client, if the value sent is -1, the client will be considered the old version, so it will not be able to get the MOTD containing rgb color.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants