forked from Upstream/mmocore
support for UClans
This commit is contained in:
parent
34c3b5bf2f
commit
16651dfe99
7
pom.xml
7
pom.xml
@ -216,6 +216,13 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.ulrich</groupId>
|
||||
<artifactId>UltimateClans</artifactId>
|
||||
<version>4.2.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Quest plugins -->
|
||||
|
||||
</dependencies>
|
||||
|
@ -1,10 +1,14 @@
|
||||
package net.Indyuce.mmocore.guild;
|
||||
|
||||
import net.Indyuce.mmocore.guild.compat.FactionsGuildModule;
|
||||
import net.Indyuce.mmocore.guild.compat.UltimateClansGuildModule;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import javax.inject.Provider;
|
||||
|
||||
public enum GuildModuleType {
|
||||
FACTIONS("Factions", FactionsGuildModule::new),
|
||||
ULTIMATE_CLANS("UltimateClans", UltimateClansGuildModule::new),
|
||||
;
|
||||
|
||||
private final String pluginName;
|
||||
|
@ -0,0 +1,28 @@
|
||||
package net.Indyuce.mmocore.guild.compat;
|
||||
|
||||
import me.ulrich.clans.data.ClanData;
|
||||
import me.ulrich.clans.packets.interfaces.UClans;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import net.Indyuce.mmocore.guild.AbstractGuild;
|
||||
import net.Indyuce.mmocore.guild.GuildModule;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class UltimateClansGuildModule implements GuildModule {
|
||||
private static final UClans API = (UClans) Bukkit.getPluginManager().getPlugin("UltimateCLans");
|
||||
|
||||
@Override
|
||||
public AbstractGuild getGuild(PlayerData playerData) {
|
||||
return API.getPlayerAPI().hasClan(playerData.getUniqueId()) ? new CustomGuild(API.getClanAPI().getClan(API.getPlayerAPI().getClanID(playerData.getUniqueId()))) : null;
|
||||
}
|
||||
|
||||
class CustomGuild implements AbstractGuild {
|
||||
|
||||
@Nullable
|
||||
private final ClanData clan;
|
||||
|
||||
CustomGuild(ClanData clan) {
|
||||
this.clan = clan;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user