Add method to check if an entry already exists in the tab list.
This commit is contained in:
@@ -57,6 +57,8 @@ public class VelocityTabList implements TabList {
|
||||
|
||||
@Override
|
||||
public Optional<TabListEntry> removeEntry(UUID uuid) {
|
||||
Preconditions.checkNotNull(uuid, "uuid");
|
||||
|
||||
TabListEntry entry = entries.remove(uuid);
|
||||
if (entry != null) {
|
||||
PlayerListItem.Item packetItem = PlayerListItem.Item.from(entry);
|
||||
@@ -67,6 +69,12 @@ public class VelocityTabList implements TabList {
|
||||
return Optional.ofNullable(entry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsEntry(UUID uuid) {
|
||||
Preconditions.checkNotNull(uuid, "uuid");
|
||||
return entries.containsKey(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all entries from the tab list. Note that the entries are written with
|
||||
* {@link MinecraftConnection#delayedWrite(Object)}, so make sure to do an explicit
|
||||
|
Reference in New Issue
Block a user