Skip to content

BukkitPlayer

GenericPlayer instance for the SpigotMC/Paper server implementation of AdvancedServerList.
This interface includes a OfflinePlayer instance obtained from the server the plugin runs on alongside some getters to get if the player has played on the server before, is banned or is whitelisted. These options actually require a proper OfflinePlayer instance to be present or will otherwise default to false.

This class is useful for cases where you want to use the OfflinePlayer. Simply cast the GenericPlayer instance to a SpigotPlayer (Granted that it actually is an instance of it to begin with).

Method Summary

Modifier and Type Method Description
OfflinePlayer getPlayer() Gives the OfflinePlayer embedded in this BukkitPlayer.
boolean hasPlayedBefore() Returns whether this player has played on the server before.
boolean isBanned() Returns whether this player has been banned from the server.
boolean isWhitelisted() Returns whether this player is whitelisted on the server.
Methods inherited from ch.andre601.advancedserverlist.api.objects.GenericPlayer
getName() , getProtocol() , getUUID()

Method Detail

OfflinePlayer getPlayer()

Gives the OfflinePlayer embedded in this BukkitPlayer.

Returns:

OfflinePlayer instance

boolean hasPlayedBefore()

Returns whether this player has played on the server before.

The returned boolean may be inaccurate if AdvancedServerList was unable to obtain a valid OfflinePlayer instance.

Returns:

Boolean indicating whether this player has played on the server before.

boolean isBanned()

Returns whether this player has been banned from the server.

The returned boolean may be inaccurate if AdvancedServerList was unable to obtain a valid OfflinePlayer instance.

Returns:

Boolean indicating whether this player has been banned from the server.

boolean isWhitelisted()

Returns whether this player is whitelisted on the server.

The returned boolean may be inaccurate if AdvancedServerList was unable to obtain a valid OfflinePlayer instance.

Returns:

Boolean indicating whether this player is whitelisted on the server.