Added enable() method
This commit is contained in:
parent
f73e05776e
commit
6fa8bad7cb
@ -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.
|
/** 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 = 0, revision = 0, compatible = 1)
|
@Version(major = 1, minor = 1, revision = 0, compatible = 1)
|
||||||
public interface Module
|
public interface Module
|
||||||
{
|
{
|
||||||
/** Will be called when the module gets enabled. */
|
/** 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. */
|
* @return The status of the module, true when enabled, false when not. */
|
||||||
public boolean enabled();
|
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.
|
/** Gets called on registration of the module.
|
||||||
*
|
*
|
||||||
* @return The String used for the CommandManager to register the commands. */
|
* @return The String used for the CommandManager to register the commands. */
|
||||||
|
Reference in New Issue
Block a user