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 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.
    • registerEventListener

      void registerEventListener(EventListener listener)
      Registers an event listener.
      Parameters:
      listener - the listener to register
    • unregisterEventListener

      void unregisterEventListener(EventListener listener)
      Unregisters an event listener. If the listener is not registered, this does nothing.
      Parameters:
      listener - the listener to unregister.
    • getConsole

      SquirtgunUser getConsole()
      Gets the console as a permissible audience. This can be used to send messages.
    • getPlayer

      SquirtgunPlayer getPlayer(UUID uuid)
      Gets a player by UUID.
      Parameters:
      uuid - the UUID of the player to get
      Returns:
      the player
    • getPlayer

      @Nullable @Nullable SquirtgunPlayer getPlayer(String name)
      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

      Path getConfigPath(SquirtgunPlugin<?> plugin)
      Gets a path to a directory where config files specific to a plugin can be stored.
    • registerCommand

      void registerCommand(CommandNode<?> node, FormatProvider provider)
      Registers a command node with the server.
      Parameters:
      node - the mpde to execute