public static boolean canSend(Player player, Packet packet, MCCraftPacket[] packetWrappers, int packetId) {
AtomicReference<PacketListener[]> listenerReference = (AtomicReference<PacketListener[]>) listeners[packetId];
PacketListener[] listenerArray = listenerReference.get();
if (listenerArray != null) {
MCPacket wrapper = wrapPacket(packet, packetWrappers, packetId);
for (PacketListener listener : listenerArray) {
if (!listener.checkPacket(player, wrapper)) {
return false;
}
}