mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
Parties can now have max size limits (configurable), by default party sizes are unlimited.
This commit is contained in:
@ -15,6 +15,7 @@ import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.Sound;
|
||||
@ -51,6 +52,17 @@ public final class PartyManager {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the player can join a party, parties can have a size limit, although there is a permission to bypass this
|
||||
* @param player player who is attempting to join the party
|
||||
* @param targetParty the target party
|
||||
* @return true if party is full and cannot be joined
|
||||
*/
|
||||
public static boolean isPartyFull(Player player, Party targetParty)
|
||||
{
|
||||
return !Permissions.partySizeBypass(player) && Config.getInstance().getPartyMaxSize() >= 1 && targetParty.getOnlineMembers().size() >= Config.getInstance().getPartyMaxSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to change parties or join a new party.
|
||||
*
|
||||
|
Reference in New Issue
Block a user