Support the 26.x player data layout and add a configurable world path - #271
Open
an0nn30 wants to merge 2 commits into
Open
Support the 26.x player data layout and add a configurable world path#271an0nn30 wants to merge 2 commits into
an0nn30 wants to merge 2 commits into
Conversation
The spigot-api 1.13.2 dependency pulls in net.md-5:bungeecord-chat:1.13-SNAPSHOT transitively, which is no longer resolvable from the Spigot snapshot repository. It is still served by repo.papermc.io, so the build works again for everyone. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Newer Minecraft versions moved the player data into a "players" subdirectory of the world, so the stats now live in <world>/players/stats instead of <world>/stats. Servers that update end up with an empty web frontend, because the old path no longer exists and discovery simply finds nothing. FileSystemDataSource now detects both layouts, preferring the "players" subdirectory when it contains a stats directory. This keeps the same configuration working before and after a server update. It also accepts an arbitrary world path rather than only a world name inside the server directory, exposed to the plugin as the new "data -> worldPath" setting. This covers setups where the player data is not in the server's default world, e.g. because the world was moved or the host uses a custom world container. The server path is kept separate, since the user cache, banned players, ops and server icon are still read relative to it. Finally, a missing stats directory is now logged instead of silently producing no players at all, which made a misconfigured path hard to diagnose. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Fixes #269.
Minecraft 26.x moved the player data into a
playerssubdirectory of the world, so the statistics now live in<world>/players/statsrather than<world>/stats. Servers that update end up with an empty web frontend: discovery finds no files at the old path, so no players are collected at all.As noted in #269, CLI users can work around this by pointing
worldNameat<world>/players, but plugin users have no equivalent option, since the plugin derives the world directory from the server's default world.Changes
Automatic detection of both layouts.
FileSystemDataSourcenow resolves the player data directory by checking whether<world>/players/statsexists, falling back to<world>otherwise. This means the same configuration keeps working across a server update, in both the plugin and the CLI, and the existing CLI workaround also continues to work.New
data → worldPathsetting for the plugin.FileSystemDataSourceadditionally accepts an arbitrary world path instead of only a world name relative to the server directory. This is exposed as an optional plugin setting that defaults tonull, in which case the previous behaviour of using the server's default world applies. It covers setups where the player data is not in the default world, for example because the world was moved or the host uses a custom world container.The server path is deliberately kept separate from the world path, since
usercache.json,banned-players.json,ops.jsonandserver-icon.pngare still read relative to the server directory no matter where the world is stored.A warning when the stats directory is missing. Previously a wrong path just yielded zero players with nothing in the log, which made this quite hard to diagnose.
Updaternow logs the path it looked at.A build fix.
spigot-api1.13.2 pulls innet.md-5:bungeecord-chat:1.13-SNAPSHOTtransitively, which the Spigot snapshot repository no longer serves, so the build currently fails on a clean checkout. It is still available fromrepo.papermc.io, so that repository is added. Happy to split this into its own PR if you would prefer.Testing
Verified against a local Paper 26.1.2 test server and on a live 26.1.2 server with 27 players:
<world>/players/stats) — players and awards are collected and the frontend populates, with no exceptions in the log. This was the failing case before the change.<world>/stats) on the local test server — unchanged, still collected correctly.worldPathset to an absolute world path on the live server — collected correctly.I have not specifically exercised the missing-directory warning path or a world stored outside the server directory beyond the above, so those rest on inspection rather than a run.
Backwards compatible: no existing configuration needs to change, and
worldPathis optional and defaults tonull.