Skip to content

fix: select player info data list field#3650

Merged
dmulloy2 merged 1 commit into
dmulloy2:masterfrom
yesidodo73:fix/player-info-data-list-field-selection
Jul 11, 2026
Merged

fix: select player info data list field#3650
dmulloy2 merged 1 commit into
dmulloy2:masterfrom
yesidodo73:fix/player-info-data-list-field-selection

Conversation

@yesidodo73

Copy link
Copy Markdown
Contributor

Fixed getPlayerInfoDataLists() incorrectly including the player info actions field.

ClientboundPlayerInfoUpdatePacket contains an EnumSet<Action> for its actions and a List<Entry> for its player info entries. Since getPlayerInfoDataLists() searched for every Collection field, both fields were included in the returned modifier.

This made index 0 point to the actions field instead of the entries list. Writing PlayerInfoData to the expected index could then fail with:

ClassCastException: Cannot cast java.util.ArrayList to java.util.EnumSet

Plugins had to use the undocumented index 1 as a workaround.

The method now uses the existing getLists() helper, so only actual List fields are selected and the player info entries are available at index 0 as expected.

Validated with ./gradlew.bat clean test assemble.

Fixes #2760
Related: #3215, #3361, #3303

@dmulloy2 dmulloy2 merged commit 3385fe6 into dmulloy2:master Jul 11, 2026
3 checks passed
@yesidodo73 yesidodo73 deleted the fix/player-info-data-list-field-selection branch July 11, 2026 22:21
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.

Player Info Packet Error

2 participants