More Javadoc
This commit is contained in:
@@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
/**
|
||||
* Base class to hold the handler.
|
||||
*
|
||||
* @see Eco#getHandler()
|
||||
* @see Handler
|
||||
*/
|
||||
@UtilityClass
|
||||
public class Eco {
|
||||
|
||||
@@ -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.
|
||||
* <p>
|
||||
* It functions as a replacement for {@link JavaPlugin}.
|
||||
* <p>
|
||||
* EcoPlugin is a lot more powerful than {@link JavaPlugin} and
|
||||
* contains many methods to reduce boilerplate code and reduce
|
||||
* plugin complexity.
|
||||
* <p>
|
||||
* It is recommended to view the source code for this class to
|
||||
* gain a better understanding of how it works.
|
||||
*
|
||||
* <b>IMPORTANT: When reloading a plugin, all runnables / tasks will
|
||||
* be cancelled.</b>
|
||||
*/
|
||||
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
|
||||
|
||||
@@ -172,6 +172,14 @@ abstract class HandledCommand extends PluginDependent<EcoPlugin> 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) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
/**
|
||||
* PluginCommands are the class to be used instead of CommandExecutor.
|
||||
* <p>
|
||||
* The command will not be registered until {@link this#register()} is called.
|
||||
* The command will not be registered until register() is called.
|
||||
* <p>
|
||||
* The name cannot be the same as an existing command as this will conflict.
|
||||
*/
|
||||
|
||||
@@ -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<String, Object> values);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,11 @@ public abstract class ConfigWrapper<T extends Config> 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;
|
||||
}
|
||||
|
||||
@@ -106,6 +106,9 @@ public final class ShapedCraftingRecipe extends PluginDependent<EcoPlugin> imple
|
||||
return new Builder(plugin, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder for recipes.
|
||||
*/
|
||||
public static final class Builder {
|
||||
/**
|
||||
* The recipe parts.
|
||||
|
||||
Reference in New Issue
Block a user