From 8ad0880eeae605f05b6ba5cbb52303753227c1ca Mon Sep 17 00:00:00 2001 From: Jules Date: Wed, 19 Jan 2022 14:24:14 +0100 Subject: [PATCH] api for guild modules --- .../Indyuce/mmocore/guild/AbstractGuild.java | 4 +++ .../Indyuce/mmocore/guild/GuildModule.java | 4 +++ .../mmocore/guild/GuildModuleType.java | 25 +++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 src/main/java/net/Indyuce/mmocore/guild/AbstractGuild.java create mode 100644 src/main/java/net/Indyuce/mmocore/guild/GuildModule.java create mode 100644 src/main/java/net/Indyuce/mmocore/guild/GuildModuleType.java diff --git a/src/main/java/net/Indyuce/mmocore/guild/AbstractGuild.java b/src/main/java/net/Indyuce/mmocore/guild/AbstractGuild.java new file mode 100644 index 00000000..670c5a06 --- /dev/null +++ b/src/main/java/net/Indyuce/mmocore/guild/AbstractGuild.java @@ -0,0 +1,4 @@ +package net.Indyuce.mmocore.guild; + +public interface AbstractGuild { +} diff --git a/src/main/java/net/Indyuce/mmocore/guild/GuildModule.java b/src/main/java/net/Indyuce/mmocore/guild/GuildModule.java new file mode 100644 index 00000000..7222fd40 --- /dev/null +++ b/src/main/java/net/Indyuce/mmocore/guild/GuildModule.java @@ -0,0 +1,4 @@ +package net.Indyuce.mmocore.guild; + +public interface GuildModule { +} diff --git a/src/main/java/net/Indyuce/mmocore/guild/GuildModuleType.java b/src/main/java/net/Indyuce/mmocore/guild/GuildModuleType.java new file mode 100644 index 00000000..ceb0508f --- /dev/null +++ b/src/main/java/net/Indyuce/mmocore/guild/GuildModuleType.java @@ -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 provider; + + GuildModuleType(String pluginName, Provider provider) { + this.pluginName = pluginName; + this.provider = provider; + } + + public boolean isValid() { + return Bukkit.getPluginManager().getPlugin(pluginName) != null; + } + + public GuildModule provideModule() { + return provider.get(); + } +}