Skip to content

Commit

Permalink
feat: limit unverified clan members (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishikiyama committed Mar 19, 2024
1 parent 01c7986 commit cb314db
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
import java.util.*;

import static net.sacredlabyrinth.phaed.simpleclans.SimpleClans.lang;
import static net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager.ConfigField.CLAN_MAX_MEMBERS;
import static net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager.ConfigField.REQUEST_FREQUENCY;
import static net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager.ConfigField.*;
import static org.bukkit.ChatColor.RED;

/**
Expand Down Expand Up @@ -225,7 +224,7 @@ public void processInvite(Request req, VoteResult vote) {

if (vote.equals(VoteResult.ACCEPT)) {
ClanPlayer cp = plugin.getClanManager().getCreateClanPlayer(invited.getUniqueId());
int maxMembers = plugin.getSettingsManager().getInt(CLAN_MAX_MEMBERS);
int maxMembers = !clan.isVerified() ? plugin.getSettingsManager().getInt(CLAN_UNVERIFIED_MAX_MEMBERS) : plugin.getSettingsManager().getInt(CLAN_MAX_MEMBERS);

if (maxMembers > 0 && maxMembers > clan.getSize()) {
ChatBlock.sendMessageKey(invited, "accepted.invitation", clan.getName());
Expand All @@ -241,6 +240,7 @@ public void processInvite(Request req, VoteResult vote) {
}
}


public void processResults(Request req) {
Clan requestClan = req.getClan();
ClanPlayer requester = req.getRequester();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ public enum ConfigField {
CLAN_MAX_DESCRIPTION_LENGTH("clan.max-description-length", 120),
CLAN_MIN_DESCRIPTION_LENGTH("clan.min-description-length", 10),
CLAN_MAX_MEMBERS("clan.max-members", 25),
CLAN_UNVERIFIED_MAX_MEMBERS("clan.unverified-max-members", 10),
CLAN_MAX_ALLIANCES("clan.max-alliances", -1),
CLAN_CONFIRMATION_FOR_PROMOTE("clan.confirmation-for-promote", false),
CLAN_TRUST_MEMBERS_BY_DEFAULT("clan.trust-members-by-default", false),
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ clan:
max-description-length: 120
min-description-length: 10
max-members: 25
unverified-max-members: 10
confirmation-for-promote: false
trust-members-by-default: false
confirmation-for-demote: false
Expand Down

0 comments on commit cb314db

Please sign in to comment.