diff --git a/api/src/main/java/com/velocitypowered/api/proxy/player/PlayerSettings.java b/api/src/main/java/com/velocitypowered/api/proxy/player/PlayerSettings.java index 61faae34b..0f70e4aac 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/player/PlayerSettings.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/player/PlayerSettings.java @@ -57,6 +57,16 @@ public interface PlayerSettings { */ MainHand getMainHand(); + /** + * Returns whether the client explicitly allows listing on the + * {@link com.velocitypowered.api.proxy.player.TabList} or not in + * anonymous TabList mode. + * This feature was introduced in 1.18. + * + * @return whether or not the client explicitly allows listing. Always false on older clients. + */ + boolean isClientListingAllowed(); + enum ChatMode { SHOWN, COMMANDS_ONLY, diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientSettingsWrapper.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientSettingsWrapper.java index b9cbed7a4..402ef78d2 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientSettingsWrapper.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientSettingsWrapper.java @@ -74,5 +74,9 @@ public class ClientSettingsWrapper implements PlayerSettings { return settings.getMainHand() == 1 ? MainHand.RIGHT : MainHand.LEFT; } + @Override + public boolean isClientListingAllowed() { + return settings.isClientListingAllowed(); + } }