<commit_before>package uk.co.drnaylor.minecraft.hammer.core.listenercores;

import uk.co.drnaylor.minecraft.hammer.core.HammerCore;
import uk.co.drnaylor.minecraft.hammer.core.data.HammerBan;
import uk.co.drnaylor.minecraft.hammer.core.data.HammerIPBan;
import uk.co.drnaylor.minecraft.hammer.core.data.HammerPlayerBan;
import uk.co.drnaylor.minecraft.hammer.core.exceptions.HammerException;
import uk.co.drnaylor.minecraft.hammer.core.handlers.DatabaseConnection;
import uk.co.drnaylor.minecraft.hammer.core.text.HammerText;
import uk.co.drnaylor.minecraft.hammer.core.text.HammerTextBuilder;
import uk.co.drnaylor.minecraft.hammer.core.text.HammerTextColours;
import uk.co.drnaylor.minecraft.hammer.core.wrappers.WrappedPlayer;

import java.util.Date;
import java.util.UUID;

/**
 * Provides methods and logic for player connection events that is API agnostic
 */
public class PlayerConnectListenerCore {

    private final HammerCore core;

    public PlayerConnectListenerCore(HammerCore core) {
        this.core = core;
    }

    public HammerText handleEvent(WrappedPlayer player, String hostAddress) throws HammerException {
        HammerBan ban = getBan(player.getUUID(), hostAddress);
        if (ban == null && player.isBanned()) {
            player.unban();<commit_msg>If the player isn't banned, don't try to make a ban message for them...<commit_after>package uk.co.drnaylor.minecraft.hammer.core.listenercores;

import uk.co.drnaylor.minecraft.hammer.core.HammerCore;
import uk.co.drnaylor.minecraft.hammer.core.data.HammerBan;
import uk.co.drnaylor.minecraft.hammer.core.data.HammerIPBan;
import uk.co.drnaylor.minecraft.hammer.core.data.HammerPlayerBan;
import uk.co.drnaylor.minecraft.hammer.core.exceptions.HammerException;
import uk.co.drnaylor.minecraft.hammer.core.handlers.DatabaseConnection;
import uk.co.drnaylor.minecraft.hammer.core.text.HammerText;
import uk.co.drnaylor.minecraft.hammer.core.text.HammerTextBuilder;
import uk.co.drnaylor.minecraft.hammer.core.text.HammerTextColours;
import uk.co.drnaylor.minecraft.hammer.core.wrappers.WrappedPlayer;

import java.util.Date;
import java.util.UUID;

/**
 * Provides methods and logic for player connection events that is API agnostic
 */
public class PlayerConnectListenerCore {

    private final HammerCore core;

    public PlayerConnectListenerCore(HammerCore core) {
        this.core = core;
    }

    public HammerText handleEvent(WrappedPlayer player, String hostAddress) throws HammerException {
        HammerBan ban = getBan(player.getUUID(), hostAddress);
        if (ban == null) {
            if (player.isBanned()) {
                player.unban();
            }

{'fraction_non_alphanumeric': 0.10522360015031942, 'fraction_numerical': 0.0, 'mean_word_length': 4.388663967611336, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2376699', 'n_tokens_mistral': 902, 'n_tokens_neox': 840, 'n_words': 147}