Interface Plugin

All Known Subinterfaces:
CorePlugin, PlatformPlugin

public interface Plugin
A plugin on the server
  • Method Details

    • getPluginName

      @NotNull @NotNull String getPluginName()
      Gets the display name of the plugin
      Returns:
      The display name of the plugin
    • getPluginId

      @NotNull @NotNull String getPluginId()
      Gets the plugin id. The plugin id is what is used when the plugin namespace is used. It must follow the following rules

      - no uppercase - no spaces - no special characters

      Returns:
      The plugin id
    • getPluginVersion

      @NotNull @NotNull PluginVersion getPluginVersion()
      Gets the plugin version information
      Returns:
      The plugin version information
    • onCoreInit

      default void onCoreInit()
      Runs when the boot order of every plugin has been found. Note that this is typically on a async thread
    • onCoreReady

      default void onCoreReady()
      Runs when TranslateCore has setup its own environment. This maybe before the server, however may also while the server finishes
    • onCoreFinishedInit

      default void onCoreFinishedInit()
      Runs when the server is in the "Done" state
    • getPlatformLauncher

      @NotNull @NotNull Object getPlatformLauncher()
      Gets the native boot plugin object. Depending on implementation, this maybe a wrapper or the TranslateCore boot plugin object
      Returns:
      The native plugin
    • createConfig

      @NotNull default @NotNull Optional<ConfigurationStream.ConfigurationFile> createConfig(@NotNull @NotNull String configName, @NotNull @NotNull File file)
      Copies a internal YAML file to the provided file object.
      Parameters:
      configName - the config name
      file - The location to copy to
      Returns:
      the ConfigurationFile for the copied file
    • getConfigFolder

      @NotNull default @NotNull File getConfigFolder()
      Gets the folder for this plugins configs
      Returns:
      The folder for configs
    • getResource

      @NotNull default @NotNull Optional<InputStream> getResource(String name)
      Gets a internal file
      Parameters:
      name - The name of the file
      Returns:
      A InputStream if found Optional.empty() if not