Add full PaperMC auto-update support#359
Open
SuperChewie wants to merge 17 commits intoMinecraftServerControl:mainfrom
Open
Add full PaperMC auto-update support#359SuperChewie wants to merge 17 commits intoMinecraftServerControl:mainfrom
SuperChewie wants to merge 17 commits intoMinecraftServerControl:mainfrom
Conversation
Author
|
Should be merged along with this documentation update. MinecraftServerControl/MinecraftServerControl.github.io#18 |
Author
|
@sandain this new feature is ready for review. I have tested the upgrade via |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add full PaperMC auto-update support
Summary
This PR adds full lifecycle support for PaperMC. This allows worlds configured with
mscs-server-type=papermcto automatically track, download, and verify PaperMC builds via the PaperMC v3 Downloads API. It also reorganizes the version JSON cache into a dedicatedversions/subdirectory and ships five new unit test files.Note: Claude was used to support the development of these changes.
Motivation
PaperMC is one of the most widely used Minecraft server implementations, offering significant performance improvements over vanilla. Previously, MSCS users who wanted PaperMC had to manually manage JAR downloads and set
mscs-server-urlby hand — losing out on the automatic update flow that vanilla worlds enjoy. This change closes that gap by wiring PaperMC into the samemscs update/mscs force-updatelifecycle used by vanilla, with no extra steps required after initial configuration.Additionally, the version manifest JSON was previously stored directly in
/opt/mscs/, alongside world directories and defaults files. Collecting all cached version JSON into aversions/subfolder makes the layout cleaner and provides a natural home for the new PaperMC cache files.Before
mscs-server-type=papermcwas not a recognised value; users had to manually setmscs-server-url,mscs-server-jar, and re-set them on every PaperMC release.mscs update/mscs force-updateonly knew how to handle vanilla Minecraft; running either on a PaperMC world did nothing useful.version_manifest.jsonwas stored directly in/opt/mscs/.After
mscs-server-type=papermcinmscs.propertiesfully enables the automatic update flow:mscs updatefetchespaper_project.json(list of available MC versions and builds) and the per-versionpaper_builds_VERSION.json, then compares the SHA256 of the installed JAR against the latest build. If a newer build is available the JAR is replaced automatically — noforce-updaterequired for build bumps within the same MC version.mscs force-updatewipes all PaperMC cache files (paper_project.jsonandpaper_builds_*.json) and re-downloads everything from scratch.mscs-server-urlormscs-server-jarconfiguration is needed.mscs-paper-channelproperty (per-world) andmscs-default-paper-channel(global default) control which build channel is targeted:STABLE(default),BETA, orALPHA.getCurrentPaperVersionskips MC versions that have no build in the configured channel.getServerCurrentVersion, a new dispatch function, replaces direct calls togetCurrentMinecraftVersioningetServerVersion,getServerJar,getServerLocation, andgetServerURL, so all server-type-specific logic flows through a single case-based switch./opt/mscs/versions/. A migration script (update.d/20-versions-subfolder) moves any existingversion_manifest.json(and its.bak) into the new location onmake update.getCurrentPaperVersion,getPaperServerURL,getPaperServerChecksum), and thegetServerVersiondispatch path — all using file fixtures with no network access.