From 7b21e33aac57999c88b21f45394bcbabc11ade9e Mon Sep 17 00:00:00 2001 From: Pepich Date: Fri, 10 Mar 2017 13:44:53 +0100 Subject: [PATCH] Command registration is now up to the module --- src/com/redstoner/modules/Module.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/com/redstoner/modules/Module.java b/src/com/redstoner/modules/Module.java index 8caa732..78488b7 100644 --- a/src/com/redstoner/modules/Module.java +++ b/src/com/redstoner/modules/Module.java @@ -5,20 +5,31 @@ 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 = 2, revision = 0, compatible = 1) +@Version(major = 3, minor = 0, revision = 0, compatible = 2) public interface Module { /** Will be called when the module gets enabled. */ - public default boolean onEnable() { + public default boolean onEnable() + { return true; } + /** This methods gets called after all modules were enabled, please use this method to register commands and similar.
+ * It will only get called if and only if the module was successfully enabled. */ + public default void postEnable() + {} + /** Will be called when the module gets disabled. */ public default void onDisable() {} /** Gets called on registration of the module. + * THIS WAS ONLY KEPT FOR COMPATIBILITY REASONS. Please register commands yourself instead using the "postEnable" method. * * @return The String used for the CommandManager to register the commands. */ - public String getCommandString(); + @Deprecated + public default String getCommandString() + { + return null; + } }