diff --git a/eco-api/src/main/java/com/willfp/eco/core/Eco.java b/eco-api/src/main/java/com/willfp/eco/core/Eco.java index 4b1b98ab..b4d21c64 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/Eco.java +++ b/eco-api/src/main/java/com/willfp/eco/core/Eco.java @@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull; /** * Base class to hold the handler. * - * @see Eco#getHandler() + * @see Handler */ @UtilityClass public class Eco { diff --git a/eco-api/src/main/java/com/willfp/eco/core/EcoPlugin.java b/eco-api/src/main/java/com/willfp/eco/core/EcoPlugin.java index 689eac7c..e6d19ac8 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/EcoPlugin.java +++ b/eco-api/src/main/java/com/willfp/eco/core/EcoPlugin.java @@ -37,6 +37,21 @@ import java.util.Set; import java.util.logging.Logger; import java.util.stream.Collectors; +/** + * EcoPlugin is the base plugin class for eco-based plugins. + *

+ * It functions as a replacement for {@link JavaPlugin}. + *

+ * EcoPlugin is a lot more powerful than {@link JavaPlugin} and + * contains many methods to reduce boilerplate code and reduce + * plugin complexity. + *

+ * It is recommended to view the source code for this class to + * gain a better understanding of how it works. + * + * IMPORTANT: When reloading a plugin, all runnables / tasks will + * be cancelled. + */ public abstract class EcoPlugin extends JavaPlugin { /** * The spigot resource ID of the plugin. @@ -597,7 +612,7 @@ public abstract class EcoPlugin extends JavaPlugin { * Does not use eco config system, don't use. * * @return The bukkit config. - * @deprecated Use {@link EcoPlugin#getConfigYml()} instead. + * @deprecated Use getConfigYml() instead. */ @NotNull @Override diff --git a/eco-api/src/main/java/com/willfp/eco/core/command/impl/HandledCommand.java b/eco-api/src/main/java/com/willfp/eco/core/command/impl/HandledCommand.java index b634ac35..9d29b244 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/command/impl/HandledCommand.java +++ b/eco-api/src/main/java/com/willfp/eco/core/command/impl/HandledCommand.java @@ -172,6 +172,14 @@ abstract class HandledCommand extends PluginDependent implements Comm return (sender, args) -> new ArrayList<>(); } + /** + * If a sender can execute the command. + * + * @param sender The sender. + * @param command The command. + * @param plugin The plugin. + * @return If the sender can execute. + */ public static boolean canExecute(@NotNull final CommandSender sender, @NotNull final CommandBase command, @NotNull final EcoPlugin plugin) { diff --git a/eco-api/src/main/java/com/willfp/eco/core/command/impl/PluginCommand.java b/eco-api/src/main/java/com/willfp/eco/core/command/impl/PluginCommand.java index fb66888a..9c88714f 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/command/impl/PluginCommand.java +++ b/eco-api/src/main/java/com/willfp/eco/core/command/impl/PluginCommand.java @@ -14,7 +14,7 @@ import java.util.List; /** * PluginCommands are the class to be used instead of CommandExecutor. *

- * The command will not be registered until {@link this#register()} is called. + * The command will not be registered until register() is called. *

* The name cannot be the same as an existing command as this will conflict. */ diff --git a/eco-api/src/main/java/com/willfp/eco/core/config/wrapper/ConfigFactory.java b/eco-api/src/main/java/com/willfp/eco/core/config/wrapper/ConfigFactory.java index 62e742a3..694273fa 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/config/wrapper/ConfigFactory.java +++ b/eco-api/src/main/java/com/willfp/eco/core/config/wrapper/ConfigFactory.java @@ -21,6 +21,7 @@ public interface ConfigFactory { * @param source The class that owns the resource. * @param removeUnused Whether keys not present in the default config should be removed on update. * @param updateBlacklist Substring of keys to not add/remove keys for. + * @return The config implementation. */ Config createUpdatableYamlConfig(@NotNull String configName, @NotNull EcoPlugin plugin, @@ -36,6 +37,7 @@ public interface ConfigFactory { * @param plugin The plugin. * @param subDirectoryPath The subdirectory path. * @param source The class that owns the resource. + * @return The config implementation. */ JSONConfig createLoadableJSONConfig(@NotNull String configName, @NotNull EcoPlugin plugin, @@ -49,6 +51,7 @@ public interface ConfigFactory { * @param plugin The plugin. * @param subDirectoryPath The subdirectory path. * @param source The class that owns the resource. + * @return The config implementation. */ Config createLoadableYamlConfig(@NotNull String configName, @NotNull EcoPlugin plugin, @@ -59,6 +62,7 @@ public interface ConfigFactory { * Yaml config. * * @param config The handle. + * @return The config implementation. */ Config createYamlConfig(@NotNull YamlConfiguration config); @@ -66,6 +70,7 @@ public interface ConfigFactory { * JSON config. * * @param values The values. + * @return The config implementation. */ JSONConfig createJSONConfig(@NotNull Map values); } diff --git a/eco-api/src/main/java/com/willfp/eco/core/config/wrapper/ConfigWrapper.java b/eco-api/src/main/java/com/willfp/eco/core/config/wrapper/ConfigWrapper.java index f344bbbb..7f5cc9cc 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/config/wrapper/ConfigWrapper.java +++ b/eco-api/src/main/java/com/willfp/eco/core/config/wrapper/ConfigWrapper.java @@ -29,6 +29,11 @@ public abstract class ConfigWrapper implements Config { @Getter private final T handle; + /** + * Create a config wrapper. + * + * @param handle The config that is being wrapped. + */ protected ConfigWrapper(@NotNull final T handle) { this.handle = handle; } diff --git a/eco-api/src/main/java/com/willfp/eco/core/recipe/recipes/ShapedCraftingRecipe.java b/eco-api/src/main/java/com/willfp/eco/core/recipe/recipes/ShapedCraftingRecipe.java index 6930d18f..39322806 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/recipe/recipes/ShapedCraftingRecipe.java +++ b/eco-api/src/main/java/com/willfp/eco/core/recipe/recipes/ShapedCraftingRecipe.java @@ -106,6 +106,9 @@ public final class ShapedCraftingRecipe extends PluginDependent imple return new Builder(plugin, key); } + /** + * Builder for recipes. + */ public static final class Builder { /** * The recipe parts.