Package org.core.platform.plugin
Interface Plugin
- All Known Subinterfaces:
CorePlugin,PlatformPlugin
public interface Plugin
A plugin on the server
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull Optional<ConfigurationStream.ConfigurationFile>createConfig(@NotNull String configName, @NotNull File file)Copies a internal YAML file to the provided file object.default @NotNull FileGets the folder for this plugins configs@NotNull ObjectGets the native boot plugin object.@NotNull StringGets the plugin id.@NotNull StringGets the display name of the plugin@NotNull PluginVersionGets the plugin version informationdefault @NotNull Optional<InputStream>getResource(String name)Gets a internal filedefault voidRuns when the server is in the "Done" statedefault voidRuns when the boot order of every plugin has been found.default voidRuns when TranslateCore has setup its own environment.
-
Method Details
-
getPluginName
Gets the display name of the plugin- Returns:
- The display name of the plugin
-
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
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
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 namefile- The location to copy to- Returns:
- the ConfigurationFile for the copied file
-
getConfigFolder
Gets the folder for this plugins configs- Returns:
- The folder for configs
-
getResource
Gets a internal file- Parameters:
name- The name of the file- Returns:
- A InputStream if found
Optional.empty()if not
-