Skip to content

Better support for multiple tablist add/remove - #1872

Open
pop4959 wants to merge 2 commits into
PaperMC:dev/4.0.0from
pop4959:bulk-tablist-add-remove
Open

Better support for multiple tablist add/remove#1872
pop4959 wants to merge 2 commits into
PaperMC:dev/4.0.0from
pop4959:bulk-tablist-add-remove

Conversation

@pop4959

@pop4959 pop4959 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

The Minecraft protocol supports adding/removing multiple entries from the tab list in a single packet (see Player Info Update and Player Info Remove).

Currently, while Velocity does have an addEntries method on its TabList, the method currently processes each entry individually regardless of what entries are being updated.

default void addEntries(Iterable<TabListEntry> entries) {
for (TabListEntry entry : entries) {
addEntry(entry);
}
}

There are no subclasses of TabList which override this default behavior, meaning each individual tab list entry sends a separate packet, which is undesirable.

Similarly, removeEntry exists, but in this case there are no corresponding removeEntries methods, even though removing multiple entries is also supported (and trivial).

This PR attempts to address this by refactoring the existing code from addEntry to addEntries in VelocityTabList, where addEntries now handles batching tab list modifications into the least number of packets possible. It is not possible (to my knowledge, I'm happy to be corrected) to combine modifications that contain varying length player actions, as a restriction imposed by the protocol, since the actions must prefix the list of entries being updated. As a result, the existing addEntry method can simply delegate to addEntries passing only one entry. The removeEntries implementation is pretty straightforward, my goal there was simply to mirror the same kinds of overloads as addEntries has, and keep the same behavior of returning all of the removed TabListEntry instances.

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.

1 participant