Search in sources :

Example 1 with TriggerReactorStartEvent

use of io.github.wysohn.triggerreactor.sponge.manager.event.TriggerReactorStartEvent in project TriggerReactor by wysohn.

the class TriggerReactor method onEnable.

@Listener
public void onEnable(GameStartedServerEvent e) {
    Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
    for (Manager manager : Manager.getManagers()) {
        try {
            manager.reload();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    Sponge.getScheduler().createTaskBuilder().execute(new Runnable() {

        @Override
        public void run() {
            Sponge.getEventManager().post(new TriggerReactorStartEvent(TriggerReactor.this));
        }
    }).submit(this);
}
Also used : TriggerReactorStartEvent(io.github.wysohn.triggerreactor.sponge.manager.event.TriggerReactorStartEvent) AbstractRepeatingTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.repeating.AbstractRepeatingTriggerManager) AbstractLocationBasedTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.location.AbstractLocationBasedTriggerManager) AbstractInventoryTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.inventory.AbstractInventoryTriggerManager) AbstractAreaTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.area.AbstractAreaTriggerManager) AbstractCustomTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.custom.AbstractCustomTriggerManager) AbstractTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.AbstractTriggerManager) CauseStackManager(org.spongepowered.api.event.CauseStackManager) AbstractCommandTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.command.AbstractCommandTriggerManager) AbstractNamedTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.named.AbstractNamedTriggerManager) ScriptException(javax.script.ScriptException) IOException(java.io.IOException) CommandException(org.spongepowered.api.command.CommandException) Listener(org.spongepowered.api.event.Listener)

Aggregations

AbstractTriggerManager (io.github.wysohn.triggerreactor.core.manager.trigger.AbstractTriggerManager)1 AbstractAreaTriggerManager (io.github.wysohn.triggerreactor.core.manager.trigger.area.AbstractAreaTriggerManager)1 AbstractCommandTriggerManager (io.github.wysohn.triggerreactor.core.manager.trigger.command.AbstractCommandTriggerManager)1 AbstractCustomTriggerManager (io.github.wysohn.triggerreactor.core.manager.trigger.custom.AbstractCustomTriggerManager)1 AbstractInventoryTriggerManager (io.github.wysohn.triggerreactor.core.manager.trigger.inventory.AbstractInventoryTriggerManager)1 AbstractLocationBasedTriggerManager (io.github.wysohn.triggerreactor.core.manager.trigger.location.AbstractLocationBasedTriggerManager)1 AbstractNamedTriggerManager (io.github.wysohn.triggerreactor.core.manager.trigger.named.AbstractNamedTriggerManager)1 AbstractRepeatingTriggerManager (io.github.wysohn.triggerreactor.core.manager.trigger.repeating.AbstractRepeatingTriggerManager)1 TriggerReactorStartEvent (io.github.wysohn.triggerreactor.sponge.manager.event.TriggerReactorStartEvent)1 IOException (java.io.IOException)1 ScriptException (javax.script.ScriptException)1 CommandException (org.spongepowered.api.command.CommandException)1 CauseStackManager (org.spongepowered.api.event.CauseStackManager)1 Listener (org.spongepowered.api.event.Listener)1