0

Command registration is now up to the module

This commit is contained in:
Pepich 2017-03-10 13:44:53 +01:00
parent cacc6a2b95
commit 7b21e33aac

View File

@ -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. /** Interface for the Module class. Modules must always have an empty constructor to be invoked by the ModuleLoader.
* *
* @author Pepich */ * @author Pepich */
@Version(major = 1, minor = 2, revision = 0, compatible = 1) @Version(major = 3, minor = 0, revision = 0, compatible = 2)
public interface Module public interface Module
{ {
/** Will be called when the module gets enabled. */ /** Will be called when the module gets enabled. */
public default boolean onEnable() { public default boolean onEnable()
{
return true; return true;
} }
/** This methods gets called after all modules were enabled, please use this method to register commands and similar. <br/>
* 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. */ /** Will be called when the module gets disabled. */
public default void onDisable() public default void onDisable()
{} {}
/** Gets called on registration of the module. /** 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. */ * @return The String used for the CommandManager to register the commands. */
public String getCommandString(); @Deprecated
public default String getCommandString()
{
return null;
}
} }