Launcher/LaunchServer/src/main/java/pro/gravit/launchserver/components/Component.java
2021-03-27 17:22:46 +07:00

35 lines
990 B
Java

package pro.gravit.launchserver.components;
import pro.gravit.launchserver.LaunchServer;
import pro.gravit.utils.ProviderMap;
public abstract class Component {
public static final ProviderMap<Component> providers = new ProviderMap<>();
private static boolean registredComp = false;
protected String componentName;
public static void registerComponents() {
if (!registredComp) {
providers.register("authLimiter", AuthLimiterComponent.class);
providers.register("regLimiter", RegLimiterComponent.class);
providers.register("commandRemover", CommandRemoverComponent.class);
registredComp = true;
}
}
@Deprecated
public void preInit(LaunchServer launchServer) {
}
public abstract void init(LaunchServer launchServer);
public final void setComponentName(String s) {
this.componentName = s;
}
@Deprecated
public void postInit(LaunchServer launchServer) {
}
}