Skip to content

Fix WrapperPlayServerStatistics read on 1.13+ servers - #1560

Merged
booky10 merged 3 commits into
retrooper:2.0from
ramenrrami:2.0
Oct 15, 2026
Merged

booky10 merged 3 commits into
retrooper:2.0from
ramenrrami:2.0

Conversation

@ramenrrami

Copy link
Copy Markdown
Contributor

WrapperPlayServerStatistics still reads the pre-1.13 format, a map of string keyed statistics. Since 1.13 the packet uses numeric registry ids instead (category id, statistic id and value as VarInts), so constructing the wrapper on a modern server misreads the buffer and throws an IndexOutOfBoundsException (#1491).

This PR branches on ServerVersion.V_1_13 like WrapperPlayServerTabComplete does: on 1.13+ the entries are read/written as a list of StatisticEntry, the legacy map path stays untouched. getStatistics() is now @Nullable since it is only populated on pre-1.13 servers.

Fixes #1491

@booky10 booky10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made some small changes, but looks correct - thanks for the fix and sorry for the wait!

@booky10
booky10 merged commit be51239 into retrooper:2.0 Oct 15, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

IndexOutOfBoundsException when handling statistics packet

2 participants