Interface Platform
public interface Platform
A wrapper around a server platform's API, specific to a plugin.
This is a work-in-progress API and more functionality is planned.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionGets the server's authentication mode.getConfigPath(SquirtgunPlugin<?> plugin)Gets a path to a directory where config files specific to a plugin can be stored.Gets the console as a permissible audience.Gets the event manager which can be used to dispatch and listen for events.Gets the plugin's logger for logging text to the console.Gets a list of all online players.@Nullable SquirtgunPlayerGets a player by cached name.Gets a player by UUID.Gets the server's task scheduler.voidlog(net.kyori.adventure.text.Component component)Logs a formatted component to the console.name()Gets this platform's user-friendly name.voidregisterCommand(CommandNode<?> node, FormatProvider provider)Registers a command node with the server.
-
Method Details
-
name
String name()Gets this platform's user-friendly name. -
getLogger
Logger getLogger()Gets the plugin's logger for logging text to the console. -
log
void log(net.kyori.adventure.text.Component component)Logs a formatted component to the console.- Parameters:
component- the component to log
-
getAuthMode
AuthMode getAuthMode()Gets the server's authentication mode. -
getTaskScheduler
TaskScheduler getTaskScheduler()Gets the server's task scheduler. -
getEventManager
EventManager getEventManager()Gets the event manager which can be used to dispatch and listen for events. -
getConsole
SquirtgunUser getConsole()Gets the console as a permissible audience. This can be used to send messages. -
getPlayer
Gets a player by UUID.- Parameters:
uuid- the UUID of the player to get- Returns:
- the player
-
getPlayer
Gets a player by cached name.- Parameters:
name- the name of the player to get- Returns:
- the player with the given name, or null if a player with that name has not played on the server before.
-
getOnlinePlayers
List<SquirtgunPlayer> getOnlinePlayers()Gets a list of all online players. -
getConfigPath
Gets a path to a directory where config files specific to a plugin can be stored. -
registerCommand
Registers a command node with the server.- Parameters:
node- the mpde to execute
-