geforkt von Mirrors/Velocity
Merge pull request #342 from xxDark/tab
Return earlier, predict list's size for tab clearing
Dieser Commit ist enthalten in:
Commit
fc51f1c203
@ -89,14 +89,16 @@ public class VelocityTabList implements TabList {
|
||||
* MinecraftConnection#flush()}.
|
||||
*/
|
||||
public void clearAll() {
|
||||
List<PlayerListItem.Item> items = new ArrayList<>();
|
||||
for (TabListEntry value : entries.values()) {
|
||||
Collection<VelocityTabListEntry> listEntries = entries.values();
|
||||
if (listEntries.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<PlayerListItem.Item> items = new ArrayList<>(listEntries.size());
|
||||
for (TabListEntry value : listEntries) {
|
||||
items.add(PlayerListItem.Item.from(value));
|
||||
}
|
||||
entries.clear();
|
||||
if (!items.isEmpty()) {
|
||||
connection.delayedWrite(new PlayerListItem(PlayerListItem.REMOVE_PLAYER, items));
|
||||
}
|
||||
connection.delayedWrite(new PlayerListItem(PlayerListItem.REMOVE_PLAYER, items));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren