2019-06-02 05:03:08 +03:00
|
|
|
package pro.gravit.launchserver.components;
|
2019-03-13 12:13:21 +03:00
|
|
|
|
2019-06-02 05:03:08 +03:00
|
|
|
import pro.gravit.launchserver.LaunchServer;
|
|
|
|
import pro.gravit.utils.ProviderMap;
|
2019-03-13 12:13:21 +03:00
|
|
|
|
2019-03-13 12:24:28 +03:00
|
|
|
public abstract class Component {
|
2019-10-19 19:43:25 +03:00
|
|
|
public static final ProviderMap<Component> providers = new ProviderMap<>();
|
2019-03-13 12:13:21 +03:00
|
|
|
private static boolean registredComp = false;
|
2021-03-26 17:56:17 +03:00
|
|
|
protected String componentName;
|
2019-03-13 12:13:21 +03:00
|
|
|
|
|
|
|
public static void registerComponents() {
|
|
|
|
if (!registredComp) {
|
2019-04-27 13:05:49 +03:00
|
|
|
providers.register("authLimiter", AuthLimiterComponent.class);
|
2019-07-01 12:07:33 +03:00
|
|
|
providers.register("regLimiter", RegLimiterComponent.class);
|
2019-04-27 13:05:49 +03:00
|
|
|
providers.register("commandRemover", CommandRemoverComponent.class);
|
2019-03-13 12:13:21 +03:00
|
|
|
registredComp = true;
|
|
|
|
}
|
|
|
|
}
|
2019-04-03 16:27:40 +03:00
|
|
|
|
2021-03-26 17:56:17 +03:00
|
|
|
@Deprecated
|
|
|
|
public void preInit(LaunchServer launchServer) {
|
|
|
|
|
|
|
|
}
|
2019-04-03 16:27:40 +03:00
|
|
|
|
2019-03-13 12:24:28 +03:00
|
|
|
public abstract void init(LaunchServer launchServer);
|
2019-04-03 16:27:40 +03:00
|
|
|
|
2021-03-26 17:56:17 +03:00
|
|
|
public final void setComponentName(String s) {
|
|
|
|
this.componentName = s;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Deprecated
|
|
|
|
public void postInit(LaunchServer launchServer) {
|
|
|
|
|
|
|
|
}
|
2019-03-13 12:13:21 +03:00
|
|
|
}
|