mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-24 00:15:16 +01:00
api for guild modules
This commit is contained in:
parent
f7f7de6c6f
commit
8ad0880eea
@ -0,0 +1,4 @@
|
||||
package net.Indyuce.mmocore.guild;
|
||||
|
||||
public interface AbstractGuild {
|
||||
}
|
4
src/main/java/net/Indyuce/mmocore/guild/GuildModule.java
Normal file
4
src/main/java/net/Indyuce/mmocore/guild/GuildModule.java
Normal file
@ -0,0 +1,4 @@
|
||||
package net.Indyuce.mmocore.guild;
|
||||
|
||||
public interface GuildModule {
|
||||
}
|
25
src/main/java/net/Indyuce/mmocore/guild/GuildModuleType.java
Normal file
25
src/main/java/net/Indyuce/mmocore/guild/GuildModuleType.java
Normal 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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user