forked from Upstream/Velocitab
Added VelocitabAPI#getServerGroup and fixed problem while un-vanishing
This commit is contained in:
parent
83195d0e72
commit
938ce9e077
@ -163,6 +163,18 @@ import java.util.Optional;
|
||||
plugin.getVanishManager().unVanishPlayer(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the server group that the given player is connected to.
|
||||
*
|
||||
* @param player the player for whom to retrieve the server group
|
||||
* @return the name of the server group that the player is connected to,
|
||||
* or an empty string if the player is not in a group server
|
||||
*/
|
||||
@NotNull
|
||||
public String getServerGroup(@NotNull Player player) {
|
||||
return getUser(player).map(t -> t.getServerGroup(plugin)).orElse("");
|
||||
}
|
||||
|
||||
|
||||
static final class NotRegisteredException extends IllegalStateException {
|
||||
|
||||
|
@ -444,6 +444,8 @@ public class PlayerTabList {
|
||||
|
||||
if (!p.getPlayer().getTabList().containsEntry(uuid)) {
|
||||
p.getPlayer().getTabList().addEntry(createEntry(tabPlayer, p.getPlayer().getTabList(), c));
|
||||
} else {
|
||||
p.getPlayer().getTabList().getEntry(uuid).ifPresent(entry -> entry.setDisplayName(c));
|
||||
}
|
||||
}));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user