mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 04:32:50 -04:00
add plugins loaded event (#830)
This commit is contained in:
parent
3298c7b6d5
commit
3648989f26
@ -126,4 +126,13 @@ namespace MCGalaxy.Events.ServerEvents
|
||||
CallCommon(pl => pl(p, channel, data));
|
||||
}
|
||||
}
|
||||
|
||||
public delegate void OnPluginsLoaded();
|
||||
/// <summary>Called when all plugins have been auto-loaded.</summary>
|
||||
public sealed class OnPluginsLoadedEvent : IEvent<OnPluginsLoaded> {
|
||||
public static void Call() {
|
||||
if (handlers.Count == 0) return;
|
||||
CallCommon(pl => pl());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using MCGalaxy.DB;
|
||||
using MCGalaxy.Events.ServerEvents;
|
||||
using MCGalaxy.Generator;
|
||||
using MCGalaxy.Network;
|
||||
using MCGalaxy.Tasks;
|
||||
@ -46,7 +47,11 @@ namespace MCGalaxy
|
||||
LevelInfo.Add(mainLevel);
|
||||
}
|
||||
|
||||
static void LoadAllPlugins(SchedulerTask task) { Plugin.LoadAll(); }
|
||||
static void LoadAllPlugins(SchedulerTask task)
|
||||
{
|
||||
Plugin.LoadAll();
|
||||
OnPluginsLoadedEvent.Call();
|
||||
}
|
||||
|
||||
static void InitPlayerLists(SchedulerTask task) {
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user