diff --git a/api/src/main/java/org/allaymc/api/plugin/PluginDescriptor.java b/api/src/main/java/org/allaymc/api/plugin/PluginDescriptor.java index 8be6427af..4bf97d3a9 100644 --- a/api/src/main/java/org/allaymc/api/plugin/PluginDescriptor.java +++ b/api/src/main/java/org/allaymc/api/plugin/PluginDescriptor.java @@ -21,20 +21,52 @@ static void checkDescriptorValid(PluginDescriptor descriptor) { Preconditions.checkNotNull(Semver.coerce(descriptor.getVersion()), "Plugin version cannot be coerced (Use https://semver.org/)"); } + /** + * Get the name of the plugin. + * + * @return the name of the plugin. + */ String getName(); + /** + * Get the entrance of the plugin. + * + * @return the entrance of the plugin. + */ String getEntrance(); - // Plugins can leave this information unavailable + /** + * Get the description of the plugin. + * + * @return the description of the plugin. + */ String getDescription(); + /** + * Get the version of the plugin. + * + * @return the version of the plugin. + */ String getVersion(); + /** + * Get the authors of the plugin. + * + * @return the authors of the plugin. + */ List getAuthors(); - // Plugins can leave this information unavailable + /** + * Get the dependencies of the plugin. + * + * @return the dependencies of the plugin. + */ List getDependencies(); - // Plugins can leave this information unavailable + /** + * Get the website of the plugin. + * + * @return the website of the plugin. + */ String getWebsite(); } diff --git a/server/src/main/java/org/allaymc/server/plugin/SimplePluginDescriptor.java b/server/src/main/java/org/allaymc/server/plugin/SimplePluginDescriptor.java index 7e5203606..c6e0acbfe 100644 --- a/server/src/main/java/org/allaymc/server/plugin/SimplePluginDescriptor.java +++ b/server/src/main/java/org/allaymc/server/plugin/SimplePluginDescriptor.java @@ -14,24 +14,12 @@ public class SimplePluginDescriptor implements PluginDescriptor { private String entrance; private String name; - private String description; private String version; private List authors; - private List dependencies; - private String website; - - public String getDescription() { - if (description == null) description = ""; - return description; - } - - public List getDependencies() { - if (dependencies == null) dependencies = Collections.emptyList(); - return dependencies; - } - - public String getWebsite() { - if (website == null) website = ""; - return website; - } + // Optional + private String description = ""; + // Optional + private List dependencies = Collections.emptyList(); + // Optional + private String website = ""; }