<commit_before>package in.twizmwaz.cardinal.module.modules.team;

import in.twizmwaz.cardinal.event.PlayerChangeTeamEvent;
import in.twizmwaz.cardinal.match.Match;
import in.twizmwaz.cardinal.module.Module;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.HandlerList;

import java.util.HashSet;

public class TeamModule<P extends Player> extends HashSet<Player> implements Module {

    private final Match match;
    private String name;
    private final String id;
    private int max;
    private int maxOverfill;
    private int respawnLimit;
    private ChatColor color;
    private final boolean observer;

    protected TeamModule(Match match, String name, String id, int max, int maxOverfill, int respawnLimit, ChatColor color, boolean observer) {
        this.match = match;
        this.name = name;
        this.id = id;
        this.max = max;
        this.maxOverfill = maxOverfill;
        this.respawnLimit = respawnLimit;
        this.color = color;
        this.observer = observer;
    }

    public boolean add(Player player, boolean force) {
        TeamModule old = null;
        for (TeamModule team : match.getModules().getModules(TeamModule.class)) {
            if (team.contains(player)) {
                old = team;
                break;
            }
        }
        PlayerChangeTeamEvent event = new PlayerChangeTeamEvent(player, force, this, old);
        Bukkit.getServer().getPluginManager().callEvent(event);
        if (!event.isCancelled()) {
            this.add(player);
            event.getPlayer().sendMessage(ChatColor.GRAY + "You have joined " + this.getCompleteName());
            return true;
        } else return false;<commit_msg>Allow players to join whenever forced<commit_after>package in.twizmwaz.cardinal.module.modules.team;

import in.twizmwaz.cardinal.event.PlayerChangeTeamEvent;
import in.twizmwaz.cardinal.match.Match;
import in.twizmwaz.cardinal.module.Module;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.HandlerList;

import java.util.HashSet;

public class TeamModule<P extends Player> extends HashSet<Player> implements Module {

    private final Match match;
    private String name;
    private final String id;
    private int max;
    private int maxOverfill;
    private int respawnLimit;
    private ChatColor color;
    private final boolean observer;

    protected TeamModule(Match match, String name, String id, int max, int maxOverfill, int respawnLimit, ChatColor color, boolean observer) {
        this.match = match;
        this.name = name;
        this.id = id;
        this.max = max;
        this.maxOverfill = maxOverfill;
        this.respawnLimit = respawnLimit;
        this.color = color;
        this.observer = observer;
    }

    public boolean add(Player player, boolean force) {
        TeamModule old = null;
        for (TeamModule team : match.getModules().getModules(TeamModule.class)) {
            if (team.contains(player)) {
                old = team;
                break;
            }
        }
        PlayerChangeTeamEvent event = new PlayerChangeTeamEvent(player, force, this, old);
        Bukkit.getServer().getPluginManager().callEvent(event);
        if (!event.isCancelled() || force) {
            this.add(player);
            event.getPlayer().sendMessage(ChatColor.GRAY + "You have joined " + this.getCompleteName());
            return true;
        } else return false;
{'fraction_non_alphanumeric': 0.093452866069003, 'fraction_numerical': 0.0, 'mean_word_length': 2.8676470588235294, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2371536', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1035, 'n_words': 265}