SpongePowered / SpongeAPI

A Minecraft plugin API
http://www.spongepowered.org/
MIT License
1.14k stars 342 forks source link

Tab List Improvement #1529

Open SjsolisZXA opened 7 years ago

SjsolisZXA commented 7 years ago

Hello, I'd like to suggest an improvement for TabLists. If a method called .clear() could be added when one calls player.getTabList, it would be greatly appreciated. It would allow programmers such as myself to easily clear a TabList.

ST-DDT commented 7 years ago

@SjsolisZXA What is your expected result of the clear() call. Remove only all player entries or remove headers/footers as well?

A reset() method would be nice as well. (Reset the TabList to a vanilla TabList showing online players)

SjsolisZXA commented 7 years ago

@ST-DDT My expected result would be to clear all entries in the Tab List while keeping the footer and header. Would your suggested reset() method restore the Tab List to how it looks like when you log into the server?

ST-DDT commented 7 years ago

Yes.

SjsolisZXA commented 7 years ago

In that case, I think both methods would be great.

ryantheleach commented 7 years ago

.clearEntries() over .clear(), if it's only clearing the entries. .reset()

SjsolisZXA commented 7 years ago

Bumping up report.