diff --git a/pom.xml b/pom.xml index a89efa24..9d3a24ea 100644 --- a/pom.xml +++ b/pom.xml @@ -208,6 +208,13 @@ provided + + org.denizen + Dungeons + 1.0 + provided + + com.massivecraft @@ -230,6 +237,13 @@ provided + + org.kingdoms.main + Kingdoms + 1.11.15.0.0.0.1.1 + provided + + diff --git a/src/main/java/net/Indyuce/mmocore/guild/GuildModuleType.java b/src/main/java/net/Indyuce/mmocore/guild/GuildModuleType.java index 48e03605..bca192f4 100644 --- a/src/main/java/net/Indyuce/mmocore/guild/GuildModuleType.java +++ b/src/main/java/net/Indyuce/mmocore/guild/GuildModuleType.java @@ -1,13 +1,18 @@ package net.Indyuce.mmocore.guild; import net.Indyuce.mmocore.guild.compat.FactionsGuildModule; +import net.Indyuce.mmocore.guild.compat.GuildsGuildModule; import net.Indyuce.mmocore.guild.compat.UltimateClansGuildModule; +import net.Indyuce.mmocore.guild.provided.MMOCoreGuildModule; import org.bukkit.Bukkit; import javax.inject.Provider; public enum GuildModuleType { FACTIONS("Factions", FactionsGuildModule::new), + GUILDS("Guilds", GuildsGuildModule::new), + KINGDOMSX("Guilds", GuildsGuildModule::new), + MMOCORE("MMOCore", MMOCoreGuildModule::new), ULTIMATE_CLANS("UltimateClans", UltimateClansGuildModule::new), ; diff --git a/src/main/java/net/Indyuce/mmocore/guild/compat/KingdomsXGuildModule.java b/src/main/java/net/Indyuce/mmocore/guild/compat/KingdomsXGuildModule.java new file mode 100644 index 00000000..40579976 --- /dev/null +++ b/src/main/java/net/Indyuce/mmocore/guild/compat/KingdomsXGuildModule.java @@ -0,0 +1,18 @@ +package net.Indyuce.mmocore.guild.compat; + +import net.Indyuce.mmocore.api.player.PlayerData; +import net.Indyuce.mmocore.guild.AbstractGuild; +import net.Indyuce.mmocore.guild.GuildModule; + +public class KingdomsXGuildModule implements GuildModule { + + @Override + public AbstractGuild getGuild(PlayerData playerData) { + throw new RuntimeException("Not supported"); + } + + class CustomGuild implements AbstractGuild { + CustomGuild() { + } + } +} diff --git a/src/main/java/net/Indyuce/mmocore/party/PartyModuleType.java b/src/main/java/net/Indyuce/mmocore/party/PartyModuleType.java index c1bb3dc3..f6b0370a 100644 --- a/src/main/java/net/Indyuce/mmocore/party/PartyModuleType.java +++ b/src/main/java/net/Indyuce/mmocore/party/PartyModuleType.java @@ -1,21 +1,18 @@ package net.Indyuce.mmocore.party; -import net.Indyuce.mmocore.party.compat.DungeonsPartyModule; -import net.Indyuce.mmocore.party.compat.McMMOPartyModule; -import net.Indyuce.mmocore.party.compat.PAFPartyModule; -import net.Indyuce.mmocore.party.compat.PartiesPartyModule; +import net.Indyuce.mmocore.party.compat.*; import net.Indyuce.mmocore.party.provided.MMOCorePartyModule; import org.bukkit.Bukkit; import javax.inject.Provider; public enum PartyModuleType { - DUNGEONSXL("DungeonsXL", () -> new DungeonsPartyModule()), - MMOCORE("MMOCore", () -> new MMOCorePartyModule()), - PARTY_AND_FRIENDS("PartyAndFriends", () -> new PAFPartyModule()), - PARTIES("Parties", () -> new PartiesPartyModule()), - MCMMO("mcMMO", () -> new McMMOPartyModule()), - // DUNGEONS("Dungeons", null), + DUNGEONS("Dungeons", DungeonsPartyModule::new), + DUNGEONSXL("DungeonsXL", DungeonsXLPartyModule::new), + MCMMO("mcMMO", McMMOPartyModule::new), + MMOCORE("MMOCore", MMOCorePartyModule::new), + PARTIES("Parties", PartiesPartyModule::new), + PARTY_AND_FRIENDS("PartyAndFriends", PAFPartyModule::new), ; private final String pluginName; diff --git a/src/main/java/net/Indyuce/mmocore/party/compat/DungeonsPartyModule.java b/src/main/java/net/Indyuce/mmocore/party/compat/DungeonsPartyModule.java index edda8c06..ff193674 100644 --- a/src/main/java/net/Indyuce/mmocore/party/compat/DungeonsPartyModule.java +++ b/src/main/java/net/Indyuce/mmocore/party/compat/DungeonsPartyModule.java @@ -1,52 +1,37 @@ package net.Indyuce.mmocore.party.compat; -import de.erethon.dungeonsxl.DungeonsXL; -import de.erethon.dungeonsxl.api.player.PlayerGroup; import net.Indyuce.mmocore.api.player.PlayerData; import net.Indyuce.mmocore.party.AbstractParty; import net.Indyuce.mmocore.party.PartyModule; import org.bukkit.entity.Player; -import java.util.ArrayList; import java.util.List; -import java.util.UUID; public class DungeonsPartyModule implements PartyModule { @Override public AbstractParty getParty(PlayerData playerData) { - PlayerGroup group = DungeonsXL.getInstance().getPlayerGroup(playerData.getPlayer()); - return group == null ? null : new CustomParty(group); + throw new RuntimeException("Not supported"); } class CustomParty implements AbstractParty { - private final PlayerGroup group; - public CustomParty(PlayerGroup group) { - this.group = group; + public CustomParty() { } @Override public boolean hasMember(Player player) { - return group.getMembers().contains(player.getUniqueId()); + throw new RuntimeException("Not supported"); } @Override public List getOnlineMembers() { - List list = new ArrayList<>(); - - for (UUID playerUid : group.getMembers().getUniqueIds()) { - PlayerData found = PlayerData.get(playerUid); - if (found.isOnline()) - list.add(found); - } - - return list; + throw new RuntimeException("Not supported"); } @Override public int countMembers() { - return group.getMembers().getUniqueIds().size(); + throw new RuntimeException("Not supported"); } } } diff --git a/src/main/java/net/Indyuce/mmocore/party/compat/DungeonsXLPartyModule.java b/src/main/java/net/Indyuce/mmocore/party/compat/DungeonsXLPartyModule.java new file mode 100644 index 00000000..efb32c8e --- /dev/null +++ b/src/main/java/net/Indyuce/mmocore/party/compat/DungeonsXLPartyModule.java @@ -0,0 +1,52 @@ +package net.Indyuce.mmocore.party.compat; + +import de.erethon.dungeonsxl.DungeonsXL; +import de.erethon.dungeonsxl.api.player.PlayerGroup; +import net.Indyuce.mmocore.api.player.PlayerData; +import net.Indyuce.mmocore.party.AbstractParty; +import net.Indyuce.mmocore.party.PartyModule; +import org.bukkit.entity.Player; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +public class DungeonsXLPartyModule implements PartyModule { + + @Override + public AbstractParty getParty(PlayerData playerData) { + PlayerGroup group = DungeonsXL.getInstance().getPlayerGroup(playerData.getPlayer()); + return group == null ? null : new CustomParty(group); + } + + class CustomParty implements AbstractParty { + private final PlayerGroup group; + + public CustomParty(PlayerGroup group) { + this.group = group; + } + + @Override + public boolean hasMember(Player player) { + return group.getMembers().contains(player.getUniqueId()); + } + + @Override + public List getOnlineMembers() { + List list = new ArrayList<>(); + + for (UUID playerUid : group.getMembers().getUniqueIds()) { + PlayerData found = PlayerData.get(playerUid); + if (found.isOnline()) + list.add(found); + } + + return list; + } + + @Override + public int countMembers() { + return group.getMembers().getUniqueIds().size(); + } + } +}