package com.gmail.woodyc40.common.protocol.events;
import com.gmail.woodyc40.common.protocol.Packet;
import net.tridentsdk.entity.living.Player;
/**
* This event is transmitted when the server sends a packet
*
* @author Pierre C
*/
public class PacketSentEvent extends ProtocolEvent {
/** The packet sent by the server */
private final Packet packet;
/** The player target of the packet */
private final Player sender;
/**
* Constructs a new sending of a packet event
*
* @param packet the packet that is sent
* @param target the target of the packet
*/
public PacketSentEvent(Packet packet, Player target) {
this.packet = packet;
this.sender = target;
}
/**
* Obtains the packet that was sent
*
* @return the packet sent
*/
public Packet packet() {
return packet;
}
/**
* Obtains the target of the packet
*
* @return the packet target
*/
public Player target() {
return sender;
}
}