Search in sources :

Example 1 with VoxelGamesLibDisableEvent

use of com.voxelgameslib.voxelgameslib.api.event.events.VoxelGamesLibDisableEvent in project VoxelGamesLibv2 by VoxelGamesLib.

the class VoxelGamesLib method onDisable.

@Override
public void onDisable() {
    if (!enabledCleanly) {
        return;
    }
    try {
        // chat menu api
        ChatMenuAPI.disable();
        getServer().getPluginManager().callEvent(new VoxelGamesLibDisableEvent());
        try (final Timing timing = new Timing("DisableAllHandlers")) {
            configHandler.disable();
            langHandler.disable();
            tickHandler.disable();
            chatHandler.disable();
            userHandler.disable();
            roleHandler.disable();
            mapHandler.disable();
            worldHandler.disable();
            teamHandler.disable();
            eloHandler.disable();
            matchmakingHandler.disable();
            signHandler.disable();
            metricHandler.disable();
            kitHandler.disable();
            pointHandler.disable();
            commandHandler.disable();
            textureHandler.disable();
            statsHandler.disable();
            gameHandler.disable();
            moduleHandler.disable();
            eventHandler.disable();
            persistenceHandler.disable();
            errorHandler.disable();
            loggingHandler.disable();
            injector = null;
        }
    } catch (Exception ex) {
        errorHandler.handle(ex, Severity.ERROR, true);
    }
}
Also used : VoxelGamesLibDisableEvent(com.voxelgameslib.voxelgameslib.api.event.events.VoxelGamesLibDisableEvent) Timing(com.voxelgameslib.voxelgameslib.internal.timings.Timing)

Aggregations

VoxelGamesLibDisableEvent (com.voxelgameslib.voxelgameslib.api.event.events.VoxelGamesLibDisableEvent)1 Timing (com.voxelgameslib.voxelgameslib.internal.timings.Timing)1