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