forked from Upstream/mmocore
Merge branch 'feature/PartyAndFriends-For-Bungeecord-Extended-Support' into 'master'
Added Party and Friends for Bungee/Velocity Support See merge request Simonsator/mmocore!1
This commit is contained in:
commit
a65f32d94b
10
.gitignore
vendored
10
.gitignore
vendored
@ -1,8 +1,8 @@
|
|||||||
/bin/
|
bin/
|
||||||
/.m2/
|
.m2/
|
||||||
/target/
|
target/
|
||||||
/.settings/
|
.settings/
|
||||||
/.idea/
|
.idea/
|
||||||
.classpath
|
.classpath
|
||||||
.project
|
.project
|
||||||
MMOCore.eml
|
MMOCore.eml
|
||||||
|
@ -204,7 +204,6 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Party plugins -->
|
<!-- Party plugins -->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.simonsator</groupId>
|
<groupId>de.simonsator</groupId>
|
||||||
<artifactId>DevelopmentPAFSpigot</artifactId>
|
<artifactId>DevelopmentPAFSpigot</artifactId>
|
||||||
@ -212,6 +211,20 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>de.simonsator</groupId>
|
||||||
|
<artifactId>Party-and-Friends-MySQL-Edition-Spigot-API</artifactId>
|
||||||
|
<version>1.5.4-RELEASE</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>de.simonsator</groupId>
|
||||||
|
<artifactId>spigot-party-api-for-party-and-friends</artifactId>
|
||||||
|
<version>1.0.4-RELEASE</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alessiodp</groupId>
|
<groupId>com.alessiodp</groupId>
|
||||||
<artifactId>Parties</artifactId>
|
<artifactId>Parties</artifactId>
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
package net.Indyuce.mmocore.party;
|
package net.Indyuce.mmocore.party;
|
||||||
|
|
||||||
import net.Indyuce.mmocore.party.compat.DungeonsXLPartyModule;
|
import net.Indyuce.mmocore.party.compat.*;
|
||||||
import net.Indyuce.mmocore.party.compat.McMMOPartyModule;
|
|
||||||
import net.Indyuce.mmocore.party.compat.PAFPartyModule;
|
|
||||||
import net.Indyuce.mmocore.party.provided.MMOCorePartyModule;
|
import net.Indyuce.mmocore.party.provided.MMOCorePartyModule;
|
||||||
import net.Indyuce.mmocore.party.compat.PartiesPartyModule;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import javax.inject.Provider;
|
import javax.inject.Provider;
|
||||||
@ -16,6 +13,7 @@ public enum PartyModuleType {
|
|||||||
MMOCORE("MMOCore", MMOCorePartyModule::new),
|
MMOCORE("MMOCore", MMOCorePartyModule::new),
|
||||||
PARTIES("Parties", PartiesPartyModule::new),
|
PARTIES("Parties", PartiesPartyModule::new),
|
||||||
PARTY_AND_FRIENDS("PartyAndFriends", PAFPartyModule::new),
|
PARTY_AND_FRIENDS("PartyAndFriends", PAFPartyModule::new),
|
||||||
|
PARTY_AND_FRIENDS_BUNGEECORD_VELOCITY("Spigot-Party-API-PAF", PAFProxyPartyModule::new),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String pluginName;
|
private final String pluginName;
|
||||||
|
@ -0,0 +1,52 @@
|
|||||||
|
package net.Indyuce.mmocore.party.compat;
|
||||||
|
|
||||||
|
import de.simonsator.partyandfriends.spigot.api.pafplayers.PAFPlayer;
|
||||||
|
import de.simonsator.partyandfriends.spigot.api.pafplayers.PAFPlayerManager;
|
||||||
|
import de.simonsator.partyandfriends.spigot.api.party.PartyManager;
|
||||||
|
import de.simonsator.partyandfriends.spigot.api.party.PlayerParty;
|
||||||
|
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 org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class PAFProxyPartyModule implements PartyModule {
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public AbstractParty getParty(PlayerData playerData) {
|
||||||
|
PlayerParty party = PartyManager.getInstance().getParty(PAFPlayerManager.getInstance().getPlayer(playerData.getUniqueId()));
|
||||||
|
return party == null ? null : new CustomParty(party);
|
||||||
|
}
|
||||||
|
|
||||||
|
class CustomParty implements AbstractParty {
|
||||||
|
private final PlayerParty party;
|
||||||
|
|
||||||
|
public CustomParty(PlayerParty party) {
|
||||||
|
this.party = party;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasMember(Player player) {
|
||||||
|
return party.isInParty(PAFPlayerManager.getInstance().getPlayer(player.getUniqueId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PlayerData> getOnlineMembers() {
|
||||||
|
List<PlayerData> list = new ArrayList<>();
|
||||||
|
|
||||||
|
for (PAFPlayer online : party.getAllPlayers())
|
||||||
|
list.add(PlayerData.get(online.getUniqueId()));
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int countMembers() {
|
||||||
|
return party.getAllPlayers().size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
# DO NOT TOUCH
|
# DO NOT TOUCH
|
||||||
config-version: 9
|
config-version: 9
|
||||||
|
|
||||||
@ -57,7 +56,8 @@ protect-custom-mine: false
|
|||||||
# - mmocore
|
# - mmocore
|
||||||
# - dungeonsxl
|
# - dungeonsxl
|
||||||
# - parties
|
# - parties
|
||||||
# - party_and_friends
|
# - party_and_friends (Use this one if you are using Party and Friends Extended for Spigot)
|
||||||
|
# - party_and_friends_bungeecord_velocity (Use this one if you are using Party and Friends For Bungeecord, Party and Friends For Velocity or Party and Friends Extended Edition for Bungeecord/Velocity. This one requires https://www.spigotmc.org/resources/spigot-party-api-for-party-and-friends.39751/ to be installed)
|
||||||
# - mcmmo
|
# - mcmmo
|
||||||
party-plugin: mmocore
|
party-plugin: mmocore
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user