Repository navigation
Conversation
Author
|
opened by error, wanted to push to my fork |
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.
Old world stats
Adds optional support for showing the stats of a previous world next to the current ones, in both leaderboards and single-player lookups.
If no old world data is configured, the output is identical to the original mod.
What it looks like
The value outside the parentheses is the current world, the one inside is the old world.
New optional mode argument
Every
/stats <player> ...and/stats top ...command accepts an optional trailing mode, usable before or after the existing[share]flag:both(default)currentoldtotalExamples:
Notes:
(Old world),(Old world only)or(Total).[Share]button keeps the selected mode.bothfalls back tocurrentwhen there is no old data.oldandtotalreturn a clear error instead.How old data is loaded
stats/*.jsoninconfig/stats-command/old-world/stats/(an optionalusercache.jsoncan go inold-world/).StatsIndexis untouched.minecraft:custom/minecraft:play_one_minuteis mapped to the currentplay_time.UUID handling (Bedrock / Floodgate and premium players)
The old world used offline UUIDs, while the current world uses the offline UUID derived from the player name (e.g. EasyAuth with
forced-offline-uuid). To match players across worlds:00000000-0000-0000-0009-...) and premium (version 4) UUIDs are translated to the offline UUID of the player's name. Names are resolved from the old world'susercache.json, the server'susercache.json, or the server's own profile lookup.uuid-map.json("old uuid": "new uuid or player name") can override any of these by hand.Duplicate rows fix
The same person can have stats stored under several UUIDs, for example a Floodgate UUID file and its migrated offline copy. Previously this could show a player twice in a leaderboard. All UUIDs are now reduced to the canonical one before building rows, keeping the highest value, so one person is always one row.
Code changes
StatsMode(new): the four modes, header labels, and the helper that builds the share command.OldWorldStats(new): loading, UUID translation and in-memory lookup of the old stats.StatsRows(new): pure logic that builds and sorts leaderboard rows per mode. It has no Minecraft dependencies, so it can be tested on its own.StatsCommand: Brigadier tree now registers[share]/[mode]through a common helper, handlers take aStatsMode, and old data is loaded on server start and cleared on stop.README.md: new "Old world stats" section with setup, UUID matching,uuid-map.json, modes and examples.