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 receives a packet * * @author Pierre C */ public class PacketReceivedEvent extends ProtocolEvent { /** The packet sent by the player */ private final Packet packet; /** The player that sent the packet */ private final Player sender; /** * Constructs a new receival of a packet event * * @param packet the packet that is received * @param sender the target of the packet */ public PacketReceivedEvent(Packet packet, Player sender) { this.packet = packet; this.sender = sender; } /** * 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 sender() { return sender; } }