api for guild modules

This commit is contained in:
Jules 2022-01-19 14:24:14 +01:00
parent f7f7de6c6f
commit 8ad0880eea
3 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,4 @@
package net.Indyuce.mmocore.guild;
public interface AbstractGuild {
}

View File

@ -0,0 +1,4 @@
package net.Indyuce.mmocore.guild;
public interface GuildModule {
}

View File

@ -0,0 +1,25 @@
package net.Indyuce.mmocore.guild;
import org.bukkit.Bukkit;
import javax.inject.Provider;
public enum GuildModuleType {
;
private final String pluginName;
private final Provider<GuildModule> provider;
GuildModuleType(String pluginName, Provider<GuildModule> provider) {
this.pluginName = pluginName;
this.provider = provider;
}
public boolean isValid() {
return Bukkit.getPluginManager().getPlugin(pluginName) != null;
}
public GuildModule provideModule() {
return provider.get();
}
}