Class BetterTeamsExtension

java.lang.Object
com.booksaw.betterTeams.extension.BetterTeamsExtension

public abstract class BetterTeamsExtension extends Object
  • Constructor Details

    • BetterTeamsExtension

      public BetterTeamsExtension()
  • Method Details

    • onEnable

      public void onEnable()
      Called when the extension is enabled.
    • onDisable

      public void onDisable()
      Called when the extension is disabled.
    • onLoad

      public void onLoad()
      Called when the extension is loaded, before it is enabled.
    • selfDisable

      public final void selfDisable()
      just let me disable from this server
    • getPlugin

      @NotNull public final @NotNull Main getPlugin()
      Gets the main BetterTeams plugin instance.
      Returns:
      The main plugin.
    • getInfo

      @NotNull public final @NotNull ExtensionInfo getInfo()
      Gets the information about this extension, loaded from the extension.yml file.
      Returns:
      The extension's info.
    • getLogger

      @NotNull public final @NotNull ExtensionLogger getLogger()
      Gets the logger for this extension.
      Returns:
      The extension's logger.
    • getDataFolder

      @NotNull public final @NotNull File getDataFolder()
      Gets the data folder for this extension, located at /plugins/BetterTeams/extensions/{extension-name}/
      Returns:
      The extension's dedicated data folder.
    • getConfig

      @NotNull public @NotNull ConfigManager getConfig()
      Gets the extension's configuration from config.yml.
      Returns:
      The YamlConfiguration for this extension.
    • reloadConfig

      public void reloadConfig()
      Reloads the config.yml from disk.
    • saveConfig

      public void saveConfig()
      Saves the current configuration to the config.yml file.
    • saveResource

      public void saveResource(@NotNull @NotNull String resourcePath, boolean replace)
      Saves any embedded resource to the extension’s data folder.
      Parameters:
      resourcePath - path inside the jar (use '/' separators)
      replace - overwrite existing file
      Throws:
      IllegalArgumentException - if resource not found
    • getResource

      @Nullable public @Nullable InputStream getResource(@NotNull @NotNull String filename)
      Gets a raw resource from the extension jar.
      Parameters:
      filename - path inside the jar
      Returns:
      stream or null if not found
    • init

      protected final void init(ExtensionInfo info, File dataFolder, Main plugin)