<commit_before>package me.zero.client.api.event.defaults.filters;

import me.zero.client.api.event.defaults.PacketEvent;
import net.minecraft.network.Packet;

import java.util.function.Predicate;

/**
 * Basic filter for packets
 *
 * @since 1.0
 *
 * Created by Brady on 3/2/2017.
 */
public class PacketFilter implements Predicate<PacketEvent> {

    /**
     * Packets allowed by this filter
     */
    private final Class<? extends Packet<?>>[] packets;

    @SafeVarargs
    public PacketFilter(Class<? extends Packet<?>>... packets) {
        this.packets = packets;
    }

    @Override
    public boolean test(PacketEvent packetEvent) {
        for (Class<? extends Packet<?>> packet : packets)
            if (packet.isAssignableFrom(packetEvent.getClass()))
                return true;

        return false;
    }
}<commit_msg>Fixed PacketFilter (Actually, this time)<commit_after>package me.zero.client.api.event.defaults.filters;

import me.zero.client.api.event.defaults.PacketEvent;
import net.minecraft.network.Packet;

import java.util.function.Predicate;

/**
 * Basic filter for packets
 *
 * @since 1.0
 *
 * Created by Brady on 3/2/2017.
 */
public class PacketFilter implements Predicate<PacketEvent> {

    /**
     * Packets allowed by this filter
     */
    private final Class<? extends Packet<?>>[] packets;

    @SafeVarargs
    public PacketFilter(Class<? extends Packet<?>>... packets) {
        this.packets = packets;
    }

    @Override
    public boolean test(PacketEvent packetEvent) {
        for (Class<? extends Packet<?>> packet : packets)
            if (packet.isAssignableFrom(packetEvent.getPacket().getClass()))
                return true;

        return false;
    }
}
{'fraction_non_alphanumeric': 0.1198371146015125, 'fraction_numerical': 0.009307737056428156, 'mean_word_length': 2.9269406392694064, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '5219371', 'n_tokens_mistral': 512, 'n_tokens_neox': 479, 'n_words': 124}