Class PlayerManager
java.lang.Object
me.remigio07.chatplugin.api.common.player.PlayerManager
- All Implemented Interfaces:
ChatPluginManager
- Direct Known Subclasses:
ProxyPlayerManager
,ServerPlayerManager
Manager that handles
ChatPluginPlayer
s and OfflinePlayer
s.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic PlayerManager
Gets this manager's instance.abstract ChatPluginPlayer
Deprecated.Names should not be used to identify players.abstract ChatPluginPlayer
Gets a player fromgetPlayers()
by their UUID.abstract Map<UUID,
? extends ChatPluginPlayer> Gets the loadedChatPluginPlayer
s' map.abstract List<? extends ChatPluginPlayer>
getPlayers
(InetAddress ipAddress) Gets the list of loadedChatPluginPlayer
s with the specified IP address.Gets the list of loaded players' IP addresses.Gets the list of loaded players' names.int
Gets the loaded players' amount.boolean
Checks if this manager is enabled.abstract void
Loads all online players in the network (if run on a proxy) or in an enabled world (if run on a server).Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface me.remigio07.chatplugin.api.common.util.manager.ChatPluginManager
checkAvailability, isReloadable, load, reload, unload
-
Constructor Details
-
PlayerManager
public PlayerManager()
-
-
Method Details
-
isEnabled
public boolean isEnabled()Description copied from interface:ChatPluginManager
Checks if this manager is enabled.- Specified by:
isEnabled
in interfaceChatPluginManager
- Returns:
- Whether this manager is enabled
-
getPlayersNames
Gets the list of loaded players' names.- Returns:
- Enabled players' names
- See Also:
-
getPlayersIPs
Gets the list of loaded players' IP addresses.- Returns:
- Enabled players' IPs
- See Also:
-
getTotalPlayers
public int getTotalPlayers()Gets the loaded players' amount.- Returns:
- Loaded players' amount
- See Also:
-
getInstance
Gets this manager's instance.- Returns:
- Manager's instance
-
getPlayers
Gets the loadedChatPluginPlayer
s' map.Do not modify the returned map.
- Returns:
- Loaded players' map
- See Also:
-
getPlayers
Gets the list of loadedChatPluginPlayer
s with the specified IP address.- Parameters:
ipAddress
- IP address to check- Returns:
- Loaded players' map
- See Also:
-
getPlayer
Gets a player fromgetPlayers()
by their UUID.Will return
null
if the player is not loaded.- Parameters:
uuid
- Player to get- Returns:
- Loaded
ChatPluginPlayer
- See Also:
-
getPlayer
@Deprecated public abstract ChatPluginPlayer getPlayer(String name, boolean checkPattern, boolean ignoreCase) Deprecated.Names should not be used to identify players. UsegetPlayer(UUID)
instead.Gets a player fromgetPlayers()
by their name.Will return
null
if the player is not loaded.- Parameters:
name
- Player to getcheckPattern
- Whether to check the name againstUtils.USERNAME_PATTERN
ignoreCase
- Whether to ignore case when checking online players- Returns:
- Loaded
ChatPluginPlayer
- Throws:
IllegalArgumentException
- IfcheckPattern
and specified name!
Utils.isValidUsername(String)
- See Also:
-
loadOnlinePlayers
public abstract void loadOnlinePlayers()Loads all online players in the network (if run on a proxy) or in an enabled world (if run on a server).
-