Package xyz.srnyx.annoyingapi
Class PluginPlatform
java.lang.Object
xyz.srnyx.javautilities.parents.Stringable
xyz.srnyx.annoyingapi.PluginPlatform
public class PluginPlatform
extends xyz.srnyx.javautilities.parents.Stringable
Contains information about a plugin on a
PluginPlatform.Platform-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA collection ofPluginPlatformsstatic enumPlatforms that plugins can be downloaded (or checked for updates) from -
Field Summary
FieldsModifier and TypeFieldDescription@Nullable StringThe author of the plugin (only required forPluginPlatform.Platform.HANGAR)final @NotNull StringThe identifier of the plugin on the platformfinal @NotNull PluginPlatform.PlatformThe platform the plugin is on -
Constructor Summary
ConstructorsConstructorDescriptionPluginPlatform(@NotNull PluginPlatform.Platform platform, @NotNull String identifier) Creates a newPluginPlatformPluginPlatform(@NotNull PluginPlatform.Platform platform, @NotNull String identifier, @Nullable String author) Creates a newPluginPlatform -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull PluginPlatformCreates a newPluginPlatformforPluginPlatform.Platform.BUKKITstatic @NotNull PluginPlatformCreates a newPluginPlatformforPluginPlatform.Platform.EXTERNALstatic @NotNull PluginPlatformCreates a newPluginPlatformforPluginPlatform.Platform.HANGARstatic @NotNull PluginPlatformCreates a newPluginPlatformforPluginPlatform.Platform.HANGARstatic @NotNull PluginPlatformhangar(@NotNull org.bukkit.plugin.Plugin plugin) Creates a newPluginPlatformforPluginPlatform.Platform.HANGARstatic @NotNull PluginPlatformCreates a newPluginPlatformforPluginPlatform.Platform.HANGARstatic @NotNull Optional<PluginPlatform> load(@NotNull org.bukkit.configuration.ConfigurationSection section) Loads aPluginPlatformfrom aConfigurationSectionstatic @NotNull PluginPlatformCreates a newPluginPlatformforPluginPlatform.Platform.MANUALstatic @NotNull PluginPlatformCreates a newPluginPlatformforPluginPlatform.Platform.MODRINTHstatic @NotNull PluginPlatformCreates a newPluginPlatformforPluginPlatform.Platform.SPIGOTMethods inherited from class xyz.srnyx.javautilities.parents.Stringable
toString, toString, toString, toString, toString
-
Field Details
-
platform
The platform the plugin is on -
identifier
The identifier of the plugin on the platform -
author
The author of the plugin (only required forPluginPlatform.Platform.HANGAR)
-
-
Constructor Details
-
PluginPlatform
public PluginPlatform(@NotNull @NotNull PluginPlatform.Platform platform, @NotNull @NotNull String identifier) Creates a newPluginPlatform- Parameters:
platform-platformidentifier-identifier
-
PluginPlatform
public PluginPlatform(@NotNull @NotNull PluginPlatform.Platform platform, @NotNull @NotNull String identifier, @Nullable @Nullable String author) Creates a newPluginPlatform- Parameters:
platform-platformidentifier-identifierauthor-author
-
-
Method Details
-
load
@NotNull public static @NotNull Optional<PluginPlatform> load(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section) Loads aPluginPlatformfrom aConfigurationSection- Parameters:
section- the section to load from- Returns:
- the loaded
PluginPlatform
-
modrinth
Creates a newPluginPlatformforPluginPlatform.Platform.MODRINTH- Parameters:
identifier-identifier- Returns:
- a new
PluginPlatform
-
hangar
@NotNull public static @NotNull PluginPlatform hangar(@NotNull @NotNull String identifier, @NotNull @NotNull String author) Creates a newPluginPlatformforPluginPlatform.Platform.HANGAR- Parameters:
identifier-identifierauthor-author- Returns:
- a new
PluginPlatform
-
hangar
@NotNull public static @NotNull PluginPlatform hangar(@NotNull @NotNull String identifier, @NotNull @NotNull org.bukkit.plugin.Plugin plugin) throws IllegalArgumentException Creates a newPluginPlatformforPluginPlatform.Platform.HANGAR- Parameters:
identifier-identifierplugin- the plugin to get theauthorfrom- Returns:
- a new
PluginPlatform - Throws:
IllegalArgumentException- if the plugin has no authors
-
hangar
@NotNull public static @NotNull PluginPlatform hangar(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull String author) Creates a newPluginPlatformforPluginPlatform.Platform.HANGAR- Parameters:
plugin- the plugin to get theidentifierfromauthor-author- Returns:
- a new
PluginPlatform
-
hangar
@NotNull public static @NotNull PluginPlatform hangar(@NotNull @NotNull org.bukkit.plugin.Plugin plugin) throws IllegalArgumentException Creates a newPluginPlatformforPluginPlatform.Platform.HANGAR- Parameters:
plugin- the plugin to get theidentifierandauthorfrom- Returns:
- a new
PluginPlatform - Throws:
IllegalArgumentException- if the plugin has no authors
-
spigot
Creates a newPluginPlatformforPluginPlatform.Platform.SPIGOT- Parameters:
identifier-identifier- Returns:
- a new
PluginPlatform
-
bukkit
Creates a newPluginPlatformforPluginPlatform.Platform.BUKKIT- Parameters:
identifier-identifier- Returns:
- a new
PluginPlatform
-
external
Creates a newPluginPlatformforPluginPlatform.Platform.EXTERNAL- Parameters:
identifier-identifier- Returns:
- a new
PluginPlatform
-
manual
Creates a newPluginPlatformforPluginPlatform.Platform.MANUAL- Parameters:
identifier-identifier- Returns:
- a new
PluginPlatform
-