加几个方法用来干活
This commit is contained in:
parent
d9301f7379
commit
10279f34ad
@ -85,15 +85,24 @@ public abstract class PluginLoader {
|
||||
public void onLoading(Plugin plugin) {
|
||||
}
|
||||
|
||||
public void postLoading(Plugin plugin) {
|
||||
}
|
||||
|
||||
public void onStarting(Plugin plugin) {
|
||||
}
|
||||
|
||||
public void postStarting(Plugin plugin) {
|
||||
}
|
||||
|
||||
public void onActivated(Plugin plugin) {
|
||||
}
|
||||
|
||||
public void onStopping(Plugin plugin) {
|
||||
}
|
||||
|
||||
public void postStopping(Plugin plugin) {
|
||||
}
|
||||
|
||||
public static void addPlugin(Plugin plugin) {
|
||||
plugins.add(plugin.getName());
|
||||
}
|
||||
@ -102,10 +111,18 @@ public abstract class PluginLoader {
|
||||
registerLoader.forEach(loader -> loader.onLoading(plugin));
|
||||
}
|
||||
|
||||
public static void postLoad(Plugin plugin) {
|
||||
registerLoader.forEach(loader -> loader.postLoading(plugin));
|
||||
}
|
||||
|
||||
public static void start(Plugin plugin) {
|
||||
registerLoader.forEach(loader -> loader.onStarting(plugin));
|
||||
}
|
||||
|
||||
public static void postStart(Plugin plugin) {
|
||||
registerLoader.forEach(loader -> loader.postStarting(plugin));
|
||||
}
|
||||
|
||||
public static void active(Plugin plugin) {
|
||||
registerLoader.forEach(loader -> loader.onActivated(plugin));
|
||||
}
|
||||
@ -114,6 +131,10 @@ public abstract class PluginLoader {
|
||||
registerLoader.forEach(loader -> loader.onStopping(plugin));
|
||||
}
|
||||
|
||||
public static void postStop(Plugin plugin) {
|
||||
registerLoader.forEach(loader -> loader.postStopping(plugin));
|
||||
}
|
||||
|
||||
public static boolean isPlugin(Plugin plugin) {
|
||||
return plugins.contains(plugin.getName());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user