/*
 * This file is part of UltimateCore, licensed under the MIT License (MIT).
 *
 * Copyright (c) Bammerbom
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package bammerbom.ultimatecore.sponge.api.module;

import bammerbom.ultimatecore.sponge.config.config.module.ModuleConfig;
import org.spongepowered.api.event.game.state.GameInitializationEvent;
import org.spongepowered.api.event.game.state.GamePostInitializationEvent;
import org.spongepowered.api.event.game.state.GameStoppingEvent;
import org.spongepowered.api.text.Text;

import java.util.Optional;

public interface Module {

    /**
     * This should return name of the module
     * For example: afk, ban, etc
     */
    String getIdentifier();

    /**
     * Returns a (short) description of the module.
     * Should be only one sentence.
     *
     * @return The description
     */
    Text getDescription();

    /**
     * This should return the config this module provides, or Optional.empty() when not available.
     */
    Optional<? extends ModuleConfig> getConfig();

    /**
     * Called when the module is registered, normally during Pre-initialization.
     */
    void onRegister();

    /**
     * Called when the module is being initialized.
     * During this phase the module should register all services and commands, and it should be ready to work.
     *
     * @param event The GameInitializationEvent
     */
    void onInit(GameInitializationEvent event);

    /**
     * Called when the module is being Post-initialized.
     * During this phase the module should be able to accept api requests.
     *
     * @param event The GamePostInitializationEvent
     */
    void onPostInit(GamePostInitializationEvent event);

    /**
     * Called when the server is shutting down
     *
     * @param event The GameStoppingEvent
     */
    void onStop(GameStoppingEvent event);

}

@@ -1304,16 +1304,73 @@
 Config;%0A
+import org.spongepowered.api.event.game.GameReloadEvent;%0A
 import o
@@ -1424,32 +1424,32 @@
 alizationEvent;%0A
-
 import org.spong
@@ -1613,16 +1613,50 @@
 .Text;%0A%0A
+import javax.annotation.Nullable;%0A
 import j
@@ -2259,24 +2259,32 @@
      */%0A    
+default 
 void onRegis
@@ -2284,25 +2284,32 @@
 onRegister()
-;
+ %7B%0A    %7D
 %0A%0A    /**%0A  
@@ -2532,24 +2532,32 @@
      */%0A    
+default 
 void onInit(
@@ -2578,33 +2578,41 @@
 tionEvent event)
-;
+ %7B%0A%0A    %7D
 %0A%0A    /**%0A     *
@@ -2804,24 +2804,32 @@
      */%0A    
+default 
 void onPostI
@@ -2866,17 +2866,234 @@
 t event)
-;
+ %7B%0A%0A    %7D%0A%0A    /**%0A     * Called when the game is reloaded%0A     * The config files will automatically be reloaded before this method is called%0A     */%0A    default void onReload(@Nullable GameReloadEvent event) %7B%0A%0A    %7D
 %0A%0A    /*
@@ -3202,16 +3202,24 @@
  */%0A    
+default 
 void onS
@@ -3246,13 +3246,21 @@
 t event)
-;
+ %7B%0A%0A    %7D
 %0A%0A%7D%0A

Make module methods optional