mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -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));
|
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.Collections.Generic;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using MCGalaxy.DB;
|
using MCGalaxy.DB;
|
||||||
|
using MCGalaxy.Events.ServerEvents;
|
||||||
using MCGalaxy.Generator;
|
using MCGalaxy.Generator;
|
||||||
using MCGalaxy.Network;
|
using MCGalaxy.Network;
|
||||||
using MCGalaxy.Tasks;
|
using MCGalaxy.Tasks;
|
||||||
@ -46,7 +47,11 @@ namespace MCGalaxy
|
|||||||
LevelInfo.Add(mainLevel);
|
LevelInfo.Add(mainLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LoadAllPlugins(SchedulerTask task) { Plugin.LoadAll(); }
|
static void LoadAllPlugins(SchedulerTask task)
|
||||||
|
{
|
||||||
|
Plugin.LoadAll();
|
||||||
|
OnPluginsLoadedEvent.Call();
|
||||||
|
}
|
||||||
|
|
||||||
static void InitPlayerLists(SchedulerTask task) {
|
static void InitPlayerLists(SchedulerTask task) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user