Class AlliancePlugin

java.lang.Object
net.joseplay.allianceutils.api.extensions.AlliancePlugin
All Implemented Interfaces:
AllianceUtilsExtension

public abstract class AlliancePlugin extends Object implements AllianceUtilsExtension
Base abstraction for Alliance extensions.

This class provides common infrastructure such as configuration management, resource access, task scheduling, and lifecycle metadata.

  • Field Details

    • log

      public final org.slf4j.Logger log
      Internal SLF4J logger for low-level logging.
    • activeTasks

      @Deprecated(forRemoval=true) public final Set<org.bukkit.scheduler.BukkitTask> activeTasks
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tracks active scheduled tasks for proper lifecycle management.
    • taskManager

      public final AllianceTaskManager taskManager
      Tracks active scheduled tasks for proper lifecycle management.
  • Constructor Details

    • AlliancePlugin

      public AlliancePlugin()
  • Method Details

    • getDataFolder

      public File getDataFolder()
    • setDataFolder

      public void setDataFolder(File dataFolder)
    • setExtensionName

      public void setExtensionName(String extensionName)
    • setExtensionVersion

      public void setExtensionVersion(String extensionVersion)
    • setExtensionDescription

      public void setExtensionDescription(String extensionDescription)
    • setExtensionAuthors

      public void setExtensionAuthors(List<String> extensionAuthors)
    • createDefaultConfig

      public void createDefaultConfig()
      Ensures that a default config.yml exists in the extension's data folder.

      If the file does not exist, it is extracted from the extension's JAR.

    • getResource

      public InputStream getResource(String path)
      Retrieves a resource file from inside the extension JAR.

      Returns a safe copy of the InputStream to avoid issues with closed JAR streams.

      Parameters:
      path - resource path inside the JAR
      Returns:
      InputStream or null if not found
    • getLogger

      public Logger getLogger()
      Provides a namespaced logger for the extension.
      Returns:
      custom logger instance
    • getExtensionName

      public String getExtensionName()
    • getConfig

      public org.bukkit.configuration.file.YamlConfiguration getConfig()
      Retrieves the configuration, ensuring it is initialized.
      Returns:
      configuration instance
    • getExtensionVersion

      public String getExtensionVersion()
    • getExtensionDescription

      public String getExtensionDescription()
    • getExtensionAuthors

      public List<String> getExtensionAuthors()
    • getStartTime

      public Instant getStartTime()
    • setStartTime

      public void setStartTime(Instant startTime)
    • getTaskManager

      public AllianceTaskManager getTaskManager()
    • runTask

      @Deprecated(forRemoval=true, since="use #getTaskManager \n remove in 1.7.2") public org.bukkit.scheduler.BukkitTask runTask(Runnable runnable)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Schedules a synchronous task.
    • runTask

      @Deprecated(forRemoval=true, since="use #getTaskManager \n remove in 1.7.2") public org.bukkit.scheduler.BukkitTask runTask(org.bukkit.scheduler.BukkitRunnable runnable)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • runTaskLater

      @Deprecated(forRemoval=true, since="use #getTaskManager \n remove in 1.7.2") public org.bukkit.scheduler.BukkitTask runTaskLater(Runnable runnable, long delay)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Schedules a delayed synchronous task.
    • runTaskLater

      @Deprecated(forRemoval=true, since="use #getTaskManager \n remove in 1.7.2") public org.bukkit.scheduler.BukkitTask runTaskLater(org.bukkit.scheduler.BukkitRunnable runnable, long delay)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • runTaskTimer

      @Deprecated(forRemoval=true, since="use #getTaskManager \n remove in 1.7.2") public org.bukkit.scheduler.BukkitTask runTaskTimer(Runnable runnable, long delay, long period)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Schedules a repeating synchronous task and tracks it.
    • runTaskTimer

      @Deprecated(forRemoval=true, since="use #getTaskManager \n remove in 1.7.2") public org.bukkit.scheduler.BukkitTask runTaskTimer(org.bukkit.scheduler.BukkitRunnable runnable, long delay, long period)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • runTaskAsync

      @Deprecated(forRemoval=true, since="use #getTaskManager \n remove in 1.7.2") public org.bukkit.scheduler.BukkitTask runTaskAsync(Runnable runnable)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Schedules an asynchronous task.
    • runTaskAsync

      @Deprecated(forRemoval=true, since="use #getTaskManager \n remove in 1.7.2") public org.bukkit.scheduler.BukkitTask runTaskAsync(org.bukkit.scheduler.BukkitRunnable runnable)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • runTaskAsyncTimer

      @Deprecated(forRemoval=true, since="use #getTaskManager \n remove in 1.7.2") public org.bukkit.scheduler.BukkitTask runTaskAsyncTimer(Runnable runnable, long delay, long period)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Schedules a repeating asynchronous task and tracks it.
    • runTaskAsyncTimer

      @Deprecated(forRemoval=true, since="use #getTaskManager \n remove in 1.7.2") public org.bukkit.scheduler.BukkitTask runTaskAsyncTimer(org.bukkit.scheduler.BukkitRunnable runnable, long delay, long period)
      Deprecated, for removal: This API element is subject to removal in a future version.