Package xyz.srnyx.annoyingapi.dependency
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
FieldsModifier and TypeFieldDescriptionfinal booleanWhether to attempt to enable the dependency after it has been downloadedfinal @NotNull FileThe new file of the dependency (name.jar)final @NotNull StringThe name of the dependency (from it'splugin.yml)final PluginPlatform.MultiThe platforms the dependency can be downloaded fromfinal booleanWhether the dependency is required to be installed. -
Constructor Summary
ConstructorsConstructorDescriptionAnnoyingDependency(@NotNull String name, boolean required, boolean enableAfterDownload, @NotNull PluginPlatform... platforms) Creates a new dependency instanceAnnoyingDependency(@NotNull String name, boolean required, boolean enableAfterDownload, PluginPlatform.Multi platforms) Creates a new dependency instanceAnnoyingDependency(@NotNull String name, PluginPlatform.Multi platforms, boolean required, boolean enableAfterDownload) Creates a new dependency instance -
Method Summary
Modifier and TypeMethodDescriptionbooleanThis usesBukkit.getPluginManager()to check if the dependency isn't installed.static @NotNull AnnoyingDependencyload(@NotNull org.bukkit.configuration.ConfigurationSection section) Loads a dependency from aConfigurationSectionstatic @NotNull List<AnnoyingDependency> Loads a list of dependencies from aConfigurationSectionMethods inherited from class xyz.srnyx.javautilities.parents.Stringable
toString, toString, toString, toString, toString
-
Field Details
-
name
The name of the dependency (from it'splugin.yml) -
platforms
The platforms the dependency can be downloaded from -
required
public final boolean requiredWhether the dependency is required to be installed. If the download fails and this is true, the plugin will not enableThis does NOT stop the dependency from being downloaded/installed
-
enableAfterDownload
public final boolean enableAfterDownloadWhether to attempt to enable the dependency after it has been downloaded -
file
The new file of the dependency (name.jar)
-
-
Constructor Details
-
AnnoyingDependency
public AnnoyingDependency(@NotNull @NotNull String name, @NotNull PluginPlatform.Multi platforms, boolean required, boolean enableAfterDownload) Creates a new dependency instance- Parameters:
name-nameplatforms-platformsrequired-requiredenableAfterDownload-enableAfterDownload
-
AnnoyingDependency
public AnnoyingDependency(@NotNull @NotNull String name, boolean required, boolean enableAfterDownload, @NotNull PluginPlatform.Multi platforms) Creates a new dependency instance- Parameters:
name-namerequired-requiredenableAfterDownload-enableAfterDownloadplatforms-platforms
-
AnnoyingDependency
public AnnoyingDependency(@NotNull @NotNull String name, boolean required, boolean enableAfterDownload, @NotNull @NotNull PluginPlatform... platforms) Creates a new dependency instance- Parameters:
name-namerequired-requiredenableAfterDownload-enableAfterDownloadplatforms-platforms
-
-
Method Details
-
load
@NotNull public static @NotNull AnnoyingDependency load(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section) Loads a dependency from aConfigurationSection- 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 aConfigurationSection- Parameters:
section- the section to load fromkey- the key to load from- Returns:
- the loaded dependencies
-
isNotInstalled
public boolean isNotInstalled()This usesBukkit.getPluginManager()to check if the dependency isn't installed. So it's vital thatnameis from the plugin'splugin.yml- Returns:
- whether the dependency isn't currently installed
-