Improve outdated version check
This pull request improves the outdated build check by querying the api if an update is actually available instead of blindly logging that you haven't updated in a while.
And adapts the PaperVersionFetcher.java class to the new fill v3 api with an User-Agent field in the format of
-
Paper/1.21.8-DEV-4e41aad (https://papermc.io)
When the server finishes loading and prints out Done, we query the api asynchronously and return the build status based on the four types below:
-
outdated build & version
-
outdated build
-
new version available but latest build (for the outdated version)
-
up-to-date/the newer version is experimental -> we dont log at all
This check can be disabled by specifying the appropriate system property -Dpaper.disableStartupVersionCheck
The issue is that we still want that to technically still be there if people are using the "latest" version of lets say 1.20.6, as even tho they are on the latest they obviously still should be encouraged to update.
@Owen1212055 what about adding a note even if it returns latest to check the build page if there is a new minecraft version and download it? implementing logic to check all that would be kinda complicated
"It's still recommended you check the build page in case a new minecraft version has been released" something in these lines
~~changed the message to look like this~~ changed it in a later commit again to say "you're running the latest build for your minecraft version!" instead of "you're running the latest version!" to make it clearer
Example outputs for latest as of now
outdated ->
outdated and new minecraft ver ->
rebased ontop of 1.21.6 🎇
There appears to be quite a few formatting issues ive noticed; some code isnt indented from its if statement while some is, some if statements have braces while others dont, some code is duplicated inside an if when it could just extract one part of it
There appears to be quite a few formatting issues ive noticed; some code isnt indented from its if statement while some is, some if statements have braces while others dont, some code is duplicated inside an if when it could just extract one part of it
Reformatted and added back the system property 👍
@Y2Kwastaken would you mind reviewing once again now?
Should i also change the references to fill now? and make all of them use an user agent? also what would be the correct channels now for checking if a build is experimental or not
Yes, you should change all API calls to Fill. You can find a new API reference in the Swagger UI, as noted in the announcement: https://fill.papermc.io/swagger-ui/index.html
Migrated 🎇
switched build checking to the /latest endpoint, should be good to review now; i dont foresee any changes other than related to reviews
edit: turns out i could make the logic a bit more readable now with fill so i did that
rebased to 1.21.7
rebased to 1.21.8; also are there any updates on this? would love to see this getting merged soon ^_^
rebased and changed the logic to use optionals instead of nullable strings
Rebased for 1.21.9 🐟🎇
@Toffikk needs rebase for 1.21.10
But LGTM