Launcher/LaunchServer/src/main/java/pro/gravit/launchserver/components/Component.java

36 lines
990 B
Java
Raw Normal View History

package pro.gravit.launchserver.components;
2019-03-13 12:13:21 +03:00
import pro.gravit.launchserver.LaunchServer;
import pro.gravit.utils.ProviderMap;
2019-03-13 12:13:21 +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) {
providers.register("authLimiter", AuthLimiterComponent.class);
2019-07-01 12:07:33 +03:00
providers.register("regLimiter", RegLimiterComponent.class);
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
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
}