Class AnnoyingDependency

java.lang.Object
xyz.srnyx.javautilities.parents.Stringable
xyz.srnyx.annoyingapi.dependency.AnnoyingDependency

public class AnnoyingDependency extends xyz.srnyx.javautilities.parents.Stringable
Represents a downloadable dependency
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final boolean
    Whether to attempt to enable the dependency after it has been downloaded
    final @NotNull File
    The new file of the dependency (name.jar)
    final @NotNull String
    The name of the dependency (from it's plugin.yml)
    The platforms the dependency can be downloaded from
    final boolean
    Whether the dependency is required to be installed.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AnnoyingDependency(@NotNull String name, boolean required, boolean enableAfterDownload, @NotNull PluginPlatform... platforms)
    Creates a new dependency instance
    AnnoyingDependency(@NotNull String name, boolean required, boolean enableAfterDownload, PluginPlatform.Multi platforms)
    Creates a new dependency instance
    AnnoyingDependency(@NotNull String name, PluginPlatform.Multi platforms, boolean required, boolean enableAfterDownload)
    Creates a new dependency instance
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    This uses Bukkit.getPluginManager() to check if the dependency isn't installed.
    static @NotNull AnnoyingDependency
    load(@NotNull org.bukkit.configuration.ConfigurationSection section)
    Loads a dependency from a ConfigurationSection
    static @NotNull List<AnnoyingDependency>
    loadList(@NotNull org.bukkit.configuration.ConfigurationSection section, @NotNull String key)
    Loads a list of dependencies from a ConfigurationSection

    Methods inherited from class xyz.srnyx.javautilities.parents.Stringable

    toString, toString, toString, toString, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • name

      @NotNull public final @NotNull String name
      The name of the dependency (from it's plugin.yml)
    • platforms

      @NotNull public final PluginPlatform.Multi platforms
      The platforms the dependency can be downloaded from
    • required

      public final boolean required
      Whether the dependency is required to be installed. If the download fails and this is true, the plugin will not enable

      This does NOT stop the dependency from being downloaded/installed

    • enableAfterDownload

      public final boolean enableAfterDownload
      Whether to attempt to enable the dependency after it has been downloaded
    • file

      @NotNull public final @NotNull File file
      The new file of the dependency (name.jar)
  • Constructor Details

  • Method Details

    • load

      @NotNull public static @NotNull AnnoyingDependency load(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section)
      Loads a dependency from a ConfigurationSection
      Parameters:
      section - the section to load from
      Returns:
      the loaded dependency
    • loadList

      @NotNull public static @NotNull List<AnnoyingDependency> loadList(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section, @NotNull @NotNull String key)
      Loads a list of dependencies from a ConfigurationSection
      Parameters:
      section - the section to load from
      key - the key to load from
      Returns:
      the loaded dependencies
    • isNotInstalled

      public boolean isNotInstalled()
      This uses Bukkit.getPluginManager() to check if the dependency isn't installed. So it's vital that name is from the plugin's plugin.yml
      Returns:
      whether the dependency isn't currently installed