From 6fa8bad7cb82ba3a0a770c8858e2769c016aeb10 Mon Sep 17 00:00:00 2001 From: Pepich Date: Wed, 1 Feb 2017 12:32:22 +0100 Subject: [PATCH] Added enable() method --- src/com/redstoner/modules/Module.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/com/redstoner/modules/Module.java b/src/com/redstoner/modules/Module.java index 41b3ee6..cdc55b0 100644 --- a/src/com/redstoner/modules/Module.java +++ b/src/com/redstoner/modules/Module.java @@ -5,7 +5,7 @@ import com.redstoner.annotations.Version; /** Interface for the Module class. Modules must always have an empty constructor to be invoked by the ModuleLoader. * * @author Pepich */ -@Version(major = 1, minor = 0, revision = 0, compatible = 1) +@Version(major = 1, minor = 1, revision = 0, compatible = 1) public interface Module { /** Will be called when the module gets enabled. */ @@ -21,6 +21,15 @@ public interface Module * @return The status of the module, true when enabled, false when not. */ public boolean enabled(); + /** Default implementation for the enable() method, returning weather the module was enabled or not. + * + * @return */ + public default boolean enable() + { + onEnable(); + return enabled(); + } + /** Gets called on registration of the module. * * @return The String used for the CommandManager to register the commands. */