Skip to content
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

Improve Server version checking #32

Open
BlaneyXYZ opened this issue Jun 17, 2024 · 2 comments
Open

Improve Server version checking #32

BlaneyXYZ opened this issue Jun 17, 2024 · 2 comments

Comments

@BlaneyXYZ
Copy link
Member

BlaneyXYZ commented Jun 17, 2024

Need a better way to check the version the server is running.
Although we use at WMA use Spigot so the old way of doing the 4 digit code returned via getServer().getVersion() works, this falls apart for Paper and presumably any other software that outputs something different

Need a better solution that will handle the output of getServer().getBukkitVersion(), as these seem more consistent, or research a better out right solution.

The current method falls down for 1.21 as it doesn't have a c version (a.b.c)

Examples of the output from

getServer().getBukkitVersion()
getServer().getVersion()

[20:51:29 WARN]: [RoyalCommands] 1.20.6-R0.1-SNAPSHOT
[20:51:29 WARN]: [RoyalCommands] 4194-Spigot-fcd94e2-ee95e17 (MC: 1.20.6)

[20:52:03 WARN]: [RoyalCommands] 1.21-R0.1-SNAPSHOT
[20:52:03 WARN]: [RoyalCommands] 4218-Spigot-146439e-2c9dd87 (MC: 1.21)

[21:03:07 WARN]: [RoyalCommands] 1.20.6-R0.1-SNAPSHOT
[21:03:07 WARN]: [RoyalCommands] 1.20.6-145-fe7043e (MC: 1.20.6)

First two are Spigot (obviously, last one is Paper)

@BlaneyXYZ
Copy link
Member Author

I really wanna avoid doing checks for each version i.e does version = 1.20.6-R0.1-SNAPSHOT, because this requires an update to come out for a new version to keep the updater happy

@BlaneyXYZ
Copy link
Member Author

BlaneyXYZ commented Jun 19, 2024

5220339 and fe9c1ec both kinda address this, long term a better solution should be found

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

No branches or pull requests

1 participant