Package me.neznamy.tab.api
Class TabAPI
java.lang.Object
me.neznamy.tab.api.TabAPI
The primary API class to get instances of other API classes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidSends a debug message into console if the option is enabled in config.abstract BossBarManagerReturn BossBar manager instance if the feature is enabled.abstract ConfigurationFileReturns TAB's config.yml fileabstract EventBusGets the event bus for registering listeners for TAB events.abstract FeatureManagerReturns feature manager instanceabstract PropertyConfigurationReturns TAB's group configurationabstract HeaderFooterManagerReturns header/footer manager instance if the feature is enabled.static TabAPIReturns API instance.abstract TabPlayer[]Returns collection of all online players.abstract PlaceholderManagerReturns PlaceholderManager instanceabstract TabPlayerReturns player object from given nameabstract TabPlayerReturns player object from given UUIDabstract ConfigurationFileReturns TAB's cache file used to store player toggle dataabstract ScoreboardManagerReturns scoreboard manager instance if the feature is enabled.abstract ProtocolVersionReturns server version.abstract TablistFormatManagerReturns Tablist name format manager instance if the feature is enabled.abstract TeamManagerReturns team manager instance if the feature is enabled.abstract ThreadManagerReturns TAB's Thread manager, which allows task submittingabstract PropertyConfigurationgetUsers()Returns TAB's user configurationabstract voidLogs an error into errors.log fileabstract voidsendConsoleMessage(String message, boolean translateColors) Prints message into consoleabstract voidsetBrokenFile(String file) Sets name of file with syntax error, which prevented the plugin from enabling.static voidsetInstance(TabAPI instance) Instance setter for internal use by the plugin only.
-
Constructor Details
-
TabAPI
public TabAPI()
-
-
Method Details
-
getInstance
Returns API instance. If instance was not set by the plugin, throwsIllegalStateException. This is usually caused by shading the API into own project, which is not allowed. Another option is calling the method before plugin was able to load.- Returns:
- API instance
- Throws:
IllegalStateException- If instance isnull
-
setInstance
Instance setter for internal use by the plugin only.- Parameters:
instance- API instance
-
getPlayer
Returns player object from given UUID- Parameters:
id- Player UUID- Returns:
- player object from given UUID
-
getPlayer
Returns player object from given name- Parameters:
name- Player name- Returns:
- player object from given name
-
getOnlinePlayers
Returns collection of all online players. Will return empty list if plugin is disabled (due to a broken configuration file for example).- Returns:
- collection of online players
-
getBossBarManager
Return BossBar manager instance if the feature is enabled. If not, returnsnull.- Returns:
- BossBar manager
-
getScoreboardManager
Returns scoreboard manager instance if the feature is enabled. If not, returnsnull.- Returns:
- scoreboard manager
-
getTeamManager
Returns team manager instance if the feature is enabled. If not, returnsnull.- Returns:
- team manager
-
getPlaceholderManager
Returns PlaceholderManager instance- Returns:
- PlaceholderManager instance
-
getFeatureManager
Returns feature manager instance- Returns:
- feature manager instance
-
getTablistFormatManager
Returns Tablist name format manager instance if the feature is enabled. If not, returnsnull.- Returns:
- Tablist name format manager
-
getEventBus
Gets the event bus for registering listeners for TAB events.- Returns:
- the event bus
-
getServerVersion
Returns server version. On proxy installation returns PROXY.- Returns:
- server version
-
sendConsoleMessage
Prints message into console- Parameters:
message- message to printtranslateColors-trueif colors should be translated,falseif not
-
getThreadManager
Returns TAB's Thread manager, which allows task submitting- Returns:
- ThreadManager instance
-
getPlayerCache
Returns TAB's cache file used to store player toggle data- Returns:
- TAB's player cache file
-
getConfig
Returns TAB's config.yml file- Returns:
- config.yml file
-
getGroups
Returns TAB's group configuration- Returns:
- TAB's group configuration
-
getUsers
Returns TAB's user configuration- Returns:
- TAB's user configuration
-
debug
Sends a debug message into console if the option is enabled in config.- Parameters:
message- Message to send
-
logError
Logs an error into errors.log file- Parameters:
message- Error messaget- Thrown error
-
setBrokenFile
Sets name of file with syntax error, which prevented the plugin from enabling. Internal use only.- Parameters:
file- Name of file with syntax error
-