Class Tablist
java.lang.Object
me.remigio07.chatplugin.api.server.tablist.Tablist
Represents a tablist handled by the
TablistManager.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TablistTablist used to reset a player's header and footer. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets this tablist's footer for the specified language.Gets this tablist's footers.Gets this tablist's header for the specified language.Gets this tablist's headers.getID()Gets this tablist's ID.
-
Field Details
-
NULL_TABLIST
Tablist used to reset a player's header and footer.Some of its instance methods will return
null.TablistSendEventis not called when sending this tablist.
-
-
Constructor Details
-
Tablist
Constructs a new tablist.You have two ways to send it to a player:
- using
TablistManager.sendTablist(Tablist, ChatPluginServerPlayer) - by adding it to
TablistManager.getTablists(); in this case it will be removed onChatPluginManager.unload()
- Parameters:
id- Tablist's IDheaders- Tablist's headersfooters- Tablist's footers- Throws:
IllegalArgumentException- If specified ID!TablistManager.isValidTablistID(String)NoSuchElementException- Ifheaders.get(Language.getMainLanguage()) == null || footers.get(Language.getMainLanguage()) == null
- using
-
-
Method Details
-
getID
Gets this tablist's ID.- Returns:
- Tablist's ID
-
getHeaders
Gets this tablist's headers.You may modify the returned map, but it cannot point to a
nullvalue forLanguage.getMainLanguage().- Returns:
- Tablist's headers
-
getHeader
Gets this tablist's header for the specified language.Specify
trueasavoidNullto fall back toLanguage.getMainLanguage()'s header if no header is present for the specified language. Will returnnullifgetHeaders().get(language) == null && !avoidNull.- Parameters:
language- Language used to translate the textavoidNull- Whether to avoid returningnull- Returns:
- Tablist's header
-