Skip to content

Fix WrapperPlayServerStatistics read on 1.13+ servers - #1560

Open
ramenrrami wants to merge 2 commits into
retrooper:2.0from
ramenrrami:2.0
Open

Fix WrapperPlayServerStatistics read on 1.13+ servers#1560
ramenrrami wants to merge 2 commits into
retrooper:2.0from
ramenrrami:2.0

Conversation

@ramenrrami

Copy link
Copy Markdown

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

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

1 participant