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 b4d21c64..72996060 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 @@ -1,6 +1,5 @@ package com.willfp.eco.core; -import lombok.Getter; import lombok.experimental.UtilityClass; import org.apache.commons.lang.Validate; import org.jetbrains.annotations.ApiStatus; @@ -15,26 +14,39 @@ import org.jetbrains.annotations.NotNull; public class Eco { /** * Instance of eco handler. - *
- * The handler is, in essence, a way to interface between the eco-api - * frontend module, and the eco-backend implementations. - *
- * There shouldn't really be any reason to ever use the handler - * in your own plugins, but if you want to then you can - it's - * just a part of the API like any other. */ - @Getter + @ApiStatus.Internal private Handler handler; - /** - * Set the handler. - * - * @param handler The handler. - */ + @ApiStatus.Internal public void setHandler(@NotNull final Handler handler) { Validate.isTrue(Eco.handler == null, "Already initialized!"); Eco.handler = handler; } + + /** + * Get the instance of the eco handler. + *
+ * The handler is, in essence, a way to interface between the eco-api + * frontend module, and the eco-backend implementations. + *
+ * There shouldn't really be any reason to ever use the handler + * in your own plugins, and you are likely to break things. All parts of + * the handler are abstracted into logically named parts of the API. + *
+ * In versions of eco before 6.12.0, the handler was considered part of
+ * the eco API, however it has since been moved into an internal component
+ * that shouldn't be used in your plugins.
+ *
+ * @return The handler.
+ * @apiNote As of eco 6.12.0, the handler is no longer regarded as part
+ * of the eco API. It is scheduled to be made internal-only *somehow* at
+ * some point in the future.
+ */
+ @ApiStatus.Internal
+ public Handler getHandler() {
+ return handler;
+ }
}
diff --git a/eco-api/src/main/java/com/willfp/eco/core/Handler.java b/eco-api/src/main/java/com/willfp/eco/core/Handler.java
index 40939c62..b8b0132b 100644
--- a/eco-api/src/main/java/com/willfp/eco/core/Handler.java
+++ b/eco-api/src/main/java/com/willfp/eco/core/Handler.java
@@ -19,6 +19,7 @@ import com.willfp.eco.core.requirement.RequirementFactory;
import com.willfp.eco.core.scheduling.Scheduler;
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -26,8 +27,9 @@ import java.util.List;
import java.util.logging.Logger;
/**
- * @see Eco
+ * @see Eco#getHandler()
*/
+@ApiStatus.Internal
public interface Handler {
/**
* Create a scheduler.
diff --git a/eco-api/src/main/java/com/willfp/eco/core/PluginDependent.java b/eco-api/src/main/java/com/willfp/eco/core/PluginDependent.java
index 731bf877..ae6a0ee8 100644
--- a/eco-api/src/main/java/com/willfp/eco/core/PluginDependent.java
+++ b/eco-api/src/main/java/com/willfp/eco/core/PluginDependent.java
@@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull;
*
* @param